February 10, 2022•150 words
The following commands will each start a simple web server, serving up the files in the current directory.
Just open up the browser, and navigate to the system's IP + port (e.g.
python -m http.server 8000
npx http-server ./ --port 8080
php -S 127.0.0.1:8080
ruby -run -e httpd ./ -p 8080
Rscript -e 'servr::httd()' -p8080
Caddy is a feature-rich production-ready Go-based web server, with easy configuration. Just download and use something like the following command.
Rust (with miniserve)
cargo install miniserve miniserve -p 8080 .
busybox httpd -f -p 8080
You can also share the server with someone remotely,
see: Using Ngrok to expose server to the internet