Linux

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

Posted by Weston Ganger on 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 python server 


Want me to help develop your next project or application?

Contact Us

Specializing in Ruby-on-Rails, Javascript, Multi-Platform Electron Desktop Apps and Hybrid Cordova Mobile Apps.

Recommended Posts