Simple HTTP Server for testing a static site

July 14, 2012

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.
Written by
Daniel Roberts

Director of SaaS Engineering

Read more from
Staff Blog

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