how to distribute local web server with your project - lwsjs/local-web-server GitHub Wiki
The standard convention with server applications is to add an npm start command to launch the server.
-
Install the server as a dev dependency
$ npm install local-web-server --save-dev -
Include the preferred config with your project, for example
// lws.config.js module.exports = { port: 8050, rewrite: [ { from: '/api/*', to: 'http://api-server:8080/api/$1', } ], directory: 'src' } -
Add a
startcommand to yourpackage.json:{ "scripts": { "start": "ws" } } -
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