2004-02-05 | paulb | file changeset files shortlog | [project @ 2004-02-05 00:12:17 by paulb] Added an example for BaseHTTPRequestHandler/BaseHTTPServer. |
paulb@30 | 1 | #!/usr/bin/env python |
paulb@30 | 2 | |
paulb@30 | 3 | from WebStack.Adapters import BaseHTTPRequestHandler |
paulb@30 | 4 | from SimpleApplication import SimpleResource |
paulb@30 | 5 | import BaseHTTPServer |
paulb@30 | 6 | |
paulb@30 | 7 | # Special magic incantation. |
paulb@30 | 8 | |
paulb@30 | 9 | handler = BaseHTTPRequestHandler.HandlerFactory(SimpleResource()) |
paulb@30 | 10 | address = ("", 8080) |
paulb@30 | 11 | server = BaseHTTPServer.HTTPServer(address, handler) |
paulb@30 | 12 | server.serve_forever() |
paulb@30 | 13 | |
paulb@30 | 14 | # vim: tabstop=4 expandtab shiftwidth=4 |