Skip to content

Instantly share code, notes, and snippets.

@ftiasch
Created August 13, 2015 09:52
Show Gist options
  • Star 20 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ftiasch/1fc81dc1e82df7c8f721 to your computer and use it in GitHub Desktop.
Save ftiasch/1fc81dc1e82df7c8f721 to your computer and use it in GitHub Desktop.
python SimpleHTTPServer with custom MIME types
import SimpleHTTPServer
import SocketServer
PORT = 8000
class Handler(SimpleHTTPServer.SimpleHTTPRequestHandler):
pass
Handler.extensions_map['.shtml'] = 'text/html'
httpd = SocketServer.TCPServer(("", PORT), Handler)
print "serving at port", PORT
httpd.serve_forever()
@mike-pete
Copy link

Thank you! I changed this a bit to make a quick and dirty dev server for working with js modules.

@baumanj
Copy link

baumanj commented Feb 22, 2020

Thanks! This is very handy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment