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):
used under Windows :
Open command line input in the site Directory
Http-server
Visit: http://localhost:8080 or http://127.0.0.1:8080
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 name extension (default ' HTML ') is provided -S or--silent disable log information output--cors enable cors via the Access-control-allow-origin header-o Open browser after starting service
-C Sets the cache time (seconds) for the Cache-control max-age header, e.g.-C10 for the seconds (defaults to ' 3600 '). Disable caching, then use-c-1.
-U or--UTC format the log message using UTC time
-P or--proxy Proxies all requests which can ' t is resolved locally to the given URL. e.g.:-P http://someurl.com
-S or--ssl enable HTTPS
-C or--cert SSL cert file path (DEFAULT:CERT.PEM)
-K or--key Path to SSL key file (DEFAULT:KEY.PEM).
-R or--robots provide A/robots.txt (whose content defaults to ' user-agent: *\ndisallow:/')
A simple 0 Configuration command-line HTTP server