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:/')
Reference document: a simple zero-configuration command-line HTTP server
A simple 0 configuration command line http server-http-server (nodeJs)