Created
August 13, 2015 09:52
-
-
Save ftiasch/1fc81dc1e82df7c8f721 to your computer and use it in GitHub Desktop.
python SimpleHTTPServer with custom MIME types
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks! This is very handy.