Here's a quick reference for spinning up a simple HTTP server using a single command in various programming languages. These are incredibly handy for quickly serving static files, testing local web pages, or sharing content within a local network.
| Language | Command | Default Port | Notes |
|---|---|---|---|
| Python 3 | python3 -m http.server |
8000 | The most popular and recommended option for its simplicity and ubiquity. Serves files from the current directory. You can specify a port like python3 -m http.server 8080. |
| Python 2 | python -m SimpleHTTPServer |
8000 | Legacy. Only use if you |