Simple static web server

Sometimes you need to quickly serve some static files for a preview. The good news is that you don’t have to install or configure a web server for that. If you have Python installed on your machine (which you probably do), there’s already a handy little web server ready for you.

Just run this command to serve the current folder:

python3 -m http.server 8080

The caveat is that it doesn’t support the live reload. So if you need that, a better option could be live-server from npm.

npx live-server --port=8080
← All notes