Start a local http server with Python

You can spawn a simple http server in your localhost with a single line using Python from your command line.

Python 2.x

python -m SimpleHTTPServer

Python 3.x

python -m http.server 8000
Code language: CSS (css)

Or, if you don't have an alias perhaps:

python3 -m http.server 8000
Code language: CSS (css)

About Ricard Torres

Senior Front-end Software Engineer at Netcentric, from Barcelona, Haidong Gumdo Instructor (korean martial art of the sword), street photographer, travel lover, TV addict, Boston Red Sox fan, and privacy advocate.

@ricard_dev @ricard_dev

📝 Blog 🎙 Podcast

Leave a Reply

Add <code> Some Code </code> if you need to.

*
*