Web Server One Liners

Some very handy one line commands for starting a web server for testing and development.

Run the command in the directory you wish to serve, or where provided, supply a flag for the directory.

Most of these should also work on Android via Termux (if the language can be installed).

php -S localhost:8000
python -m http.server 8000

After starting the web server, you can access content at 127.0.0.1:8000.