Http-server is a simple 0 configuration command line HTTP server, based on NodeJs.
If you don't want to write NodeJs Web-server.js repeatedly, you can use this.
installation (Global install plus-G):
Use :
Open command line input in the site Directory
Node Http-server
Used in Package.json
"Scripts": { "start": "Http-server-a 0.0.0.0-p 8000",}
Parameters :
-p port Number (default 8080)-a IP address (default 0.0.0.0)-D Display directory list (default ' true ')-i display AutoIndex (default ' true ')- E or--ext If no default file extension is provided (default ' HTML ')-S or--silent suppress log information output --cors enable cors via the access-control-allow-< C6>origin Header-o Open Browser -H or--HelpPrint List and exit for seconds (defaults to ' 3600 ') after starting service. Disable caching, then use-c-1.
Reference url:a Simple zero-configuration command-line HTTP server
A simple 0 configuration command line HTTP server-http-server (nodeJs)