usage: http-server [path] [options]
options:
-p Port to use [8080]
-a Address to use [0.0.0.0]
-d Show directory listings [true]
-i Display autoIndex [true]
-e --ext Default file extension if none supplied [none]
-s --silent Suppress log messages from output
--cors Enable CORS via the 'Access-Control-Allow-Origin' header
-o Open browser window after staring the server
-c Set cache time (in seconds). e.g. -c10 for 10 seconds.
To disable caching, use -c-1.
-h --help Print this list and exit.
On this page... (hide)
https://github.com/nodeapps/http-server - found via StackOverflow request for a simple HTTP server
This is dead-simple, and I regret not having this in my toolkit years ago.
Of course, I also regret not having NodeJs in my toolkit years ago, too.
npm i -g http-server
See Also