http_server_cli 1.0.0+1
http_server_cli: ^1.0.0+1 copied to clipboard
A zero-configuration command-line http server. inspired by `nodejs http-server`
http_server_cli #
http_server_cli is a simple, zero-configuration command-line http server. It is highly inspired by node js http-server. Internally it uses dart http_server
Installation #
If you want to use http_server_cli on the command line, install it using pub global activate:
pub global activate http_server_cli
How to run #
pub run http_server_cli
Extra options
pub run http_server_cli --port 9000 --path ./test/public --not-found index.html -d false -s
Available Options: #
-p or --port Port to use (defaults to 8080)
-a Address to use (defaults to 0.0.0.0)
-d Show directory listings (defaults to true)
-i Display autoIndex (defaults to true)
-s or --silent Suppress log messages from output
-h or --help Print this list and exit.
Features Coming soon #
--cors Enable CORS via the Access-Control-Allow-Origin header
-o [path] Open browser window after starting the server. Optionally provide a URL path to open. e.g.: -o /other/dir/
-c Set cache time (in seconds) for cache-control max-age header, e.g. -c10 for 10 seconds (defaults to 3600). To disable caching, use -c-1.
-U or --utc Use UTC time format in log messages.
--log-ip Enable logging of the client's IP address (default: false).
-P or --proxy Proxies all requests which can't be resolved locally to the given url. e.g.: -P http://someurl.com
--username Username for basic authentication [none]
--password Password for basic authentication [none]
-S or --ssl Enable https.
-C or --cert Path to ssl cert file (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: /)