--- a/bin/dev-server Mon Jan 25 22:11:10 2010 +0200
+++ b/bin/dev-server Tue Jan 26 01:26:05 2010 +0200
@@ -6,18 +6,24 @@
import pngtile.wsgi
-# dispatch on URL
-app = werkzeug.DispatcherMiddleware(pngtile.wsgi.application, {
- '/static': werkzeug.SharedDataMiddleware(NotFound(), {
- '/': 'static',
- }),
-})
+def main (host='0.0.0.0', port=8000) :
+ # original app
+ app = pngtile.wsgi.WSGIApplication()
-def main (host='0.0.0.0', port=8000) :
+ # dispatch on URL
+ # XXX: just replace with SharedDataMiddleware..
+ app = werkzeug.DispatcherMiddleware(app, {
+ '/static': werkzeug.SharedDataMiddleware(NotFound(), {
+ '/': 'static',
+ }),
+ })
+
+ # http server
httpd = wsgiref.simple_server.make_server(host, port, app)
print "Listening on %s:%d" % (host, port)
-
+
+ # go
httpd.serve_forever()
if __name__ == '__main__' :