Ever written an HTTP server? Doesn't get much easier than in Python:

$ cat ~/bin/httpserve
import sys, SimpleHTTPServer
This assumes the script is called with no arguments; it sets the port to 80 rather than 8000 which is the default for SimpleHTTPServer. Just cd to the directory you want to serve and type httpserve, and Python does the rest.

Back to blog or home page

last updated 2013-01-10 20:43:54. served from tektonic.jcomeau.com