Simple HTTP Server for testing a static site

I can’t believe I didn’t know about this earlier, but if you have html/css/js files for a static website in directory /path/to/foo, you can serve it on port 9000 (or whatever) by running

 

cd /path/to/foo

python -m SimpleHTTPServer 9000

 

 

It’s nice because file:// urls don’t let you do nice things like ajax, etc.

Share

Tags

Similar Articles

The World's Most Powerful Mobile Data Collection Platform

Start a FREE 30-day CommCare trial today. No credit card required.

Get Started

Learn More

Get the latest news delivered
straight to your inbox