Linux

How To Start An HTTP Server From Any Folder Using Python SimpleHTTPServer

Posted by Weston Ganger

November 24, 2016

If you ever have worked on a simple HTML/CSS/JS site you may want a simple solution to serve it. This is super simple thanks to python and its built in Simple HTTP Server.

cd ~/path/to/my/project/ # this folder must contain index.html

# Default, serve app on 0.0.0.0:8000
python -m SimpleHTTPServer

# Use Different Port, Ex: Port 7777
python -m SimpleHTTPServer 7777

# Run server in background (requires using pkill to stop the server though)
&python -m SimpleHTTPServer


Related External Links:

Posted in Linux and Tagged with pythonserver

Recommended Posts

Contact

604-309-8713
info@solidfoundationwebdev.com

Westonganger profile

Send Me A Message

I would love to get in touch and talk about your next project. Feel free to send a message and I will get back to you shortly.


Get Connected