Commands which you can use to start HTTP static server in your current (or specified) directory, available at http://localhost:8080.
You can find an original extended list of the commands on the willurd’s gists and on Reddit.
DISCLAIMING: All solutions provided below are only for tests or for local development, do not use it in the production environment or environment which can be reached from the public Internet.
Python Link to heading
1# Python 2.x
2python -m SimpleHTTPServer 8080
3
4# Python 3.x
5python3 -m http.server 8080
Ruby Link to heading
1# Ruby 1.9.2+
2ruby -run -ehttpd . -p8080
Node.js Link to heading
Package: http-server Link to heading
1# Install dependency fist
2npm install -g http-server
3
4# Start http server
5http-server -p 8080
Note:
index.html
will be served as the default file to any directory requests.
Busybox Link to heading
1busybox httpd -f -p 8080