April 2018
Beginner
226 pages
4h 47m
English
We have already seen that using node app.js as a command boots our server and, yes, we know about that. But we have not learned to configure the command. Node package manager (npm) provides a way to configure our server start command using a scripts key in a package.json. This can be shown in the following snippet of package.json:
{ "name": "test-node-app", "version": "1.0.0", "description": "", "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", "start": "node app.js" }, "author": "", "license": "ISC", "dependencies": { "handlebars": "^4.0.11", "hapi": "^17.2.0" }}
In the preceding code, we added a start key inside the script's literals and provided our ...
Read now
Unlock full access