This commit is contained in:
Lloyd Brookes
2016-06-20 22:57:34 +01:00
parent 3ac7258a72
commit 6100ad6f6e
2 changed files with 52 additions and 78 deletions

32
doc/distribute.md Normal file
View File

@ -0,0 +1,32 @@
## Distribute with your project
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
```sh
$ npm install local-web-server --save-dev
```
2\. Add a `start` command to your `package.json`:
```json
{
"name": "example",
"version": "1.0.0",
"local-web-server": {
"port": 8100,
"forbid": "*.json"
},
"scripts": {
"start": "ws"
}
}
```
3\. Document how to build and launch your site
```sh
$ npm install
$ npm start
serving at http://localhost:8100
```