Install express
npm install express -g
Initiate a new app
express --sessions storeski
This will create the foundation for your application. For complete list of express option type express --help
in the terminal
Use node-supervisor to start the server.
node-supervisor is a little supervisor script for nodejs. It runs your program, and watches for code changes, so you can have hot-code reloading-ish behavior, without worrying about memory leaks and making sure you clean up all the inter-module references, and without a whole new require system.
package.json
file add:
"supervisor": "0.4.x"
Also modifying "scripts" "start" command to use supervisor
"scripts": {
"start": "node_modules/.bin/supervisor app"
},
We are doing a couple things here:
npm start
supervisor
script that will be present in the node_modules/.bin
directory after we run npm install
Update modules
npm install
Start the server
npm start
For more information npm scripts please read npm scripts
View your creation