Skip to content

how to distribute local web server with your project

Lloyd Brookes edited this page Jun 21, 2017 · 2 revisions

The standard convention with client-server applications is to add an npm start command to launch the server component.

1. Install the server as a dev dependency

$ npm install local-web-server --save-dev

2. Add a start command to your package.json:

{
  "scripts": {
    "start": "ws"
  }
}

3. Document how to build and launch your site

$ npm install
$ npm start
Serving at http://mbp.local:8000, http://127.0.0.1:8000, http://192.168.0.100:8000
Clone this wiki locally