Mercurial > bugzilla-dashboard
comparison server.py @ 88:392fd25a6e21
Added server.py
author | Atul Varma <avarma@mozilla.com> |
---|---|
date | Mon, 26 Apr 2010 16:41:32 -0700 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
87:69758ef776b0 | 88:392fd25a6e21 |
---|---|
1 import os | |
2 import BaseHTTPServer | |
3 import SimpleHTTPServer | |
4 | |
5 PORT = 8000 | |
6 | |
7 def run(server_class=BaseHTTPServer.HTTPServer, | |
8 handler_class=SimpleHTTPServer.SimpleHTTPRequestHandler, | |
9 port=PORT): | |
10 server_address = ('', port) | |
11 print "Serving files in '%s' on port %d." % (os.getcwd(), port) | |
12 httpd = server_class(server_address, handler_class) | |
13 httpd.serve_forever() | |
14 | |
15 if __name__ == '__main__': | |
16 run() |