I cloned angular seed which is using node http-server
and it is working perfectly using following configuration.
Command : npm start (from root of project)
Following configuration in package.json
file:
"start": "http-server -a localhost -p 8000 -c-1",
Link to file
However I'm unable to start this server directly. eg: from root of the project, none of these commands work:
> angular-seed npm http-server
> angular-seed node http-server
> angular-seed http-server
Shouldn't this(http-server) be available here(root, where it got installed from)? Could someone please explain me how it is working and how I can use it directly from root of the project.
I'm sure it will work fine if I install it globally but I'm not interested in that.
This question is related to
npm
httpserver
To start server locally paste the below code in package.json and run npm start in command line.
"scripts": {
"start": "http-server -c-1 -p 8081"
},
Source: Stackoverflow.com