terom@36: #!/usr/bin/python terom@36: terom@36: import wsgiref.simple_server terom@36: import werkzeug terom@36: from werkzeug.exceptions import NotFound terom@36: terom@36: import pngtile.wsgi terom@36: terom@36: # dispatch on URL terom@36: app = werkzeug.DispatcherMiddleware(pngtile.wsgi.application, { terom@36: '/static': werkzeug.SharedDataMiddleware(NotFound(), { terom@36: '/': 'static', terom@36: }), terom@36: }) terom@36: terom@50: def main (host='0.0.0.0', port=8000) : terom@36: httpd = wsgiref.simple_server.make_server(host, port, app) terom@36: terom@36: print "Listening on %s:%d" % (host, port) terom@36: terom@36: httpd.serve_forever() terom@36: terom@36: if __name__ == '__main__' : terom@36: main() terom@36: