author | Tero Marttila <terom@fixme.fi> |
Mon, 25 Jan 2010 04:07:43 +0200 | |
changeset 81 | b9554b5c02fb |
parent 50 | ba9d03e46925 |
child 103 | 1a6a6957197d |
permissions | -rwxr-xr-x |
36 | 1 |
#!/usr/bin/python |
2 |
||
3 |
import wsgiref.simple_server |
|
4 |
import werkzeug |
|
5 |
from werkzeug.exceptions import NotFound |
|
6 |
||
7 |
import pngtile.wsgi |
|
8 |
||
9 |
# dispatch on URL |
|
10 |
app = werkzeug.DispatcherMiddleware(pngtile.wsgi.application, { |
|
11 |
'/static': werkzeug.SharedDataMiddleware(NotFound(), { |
|
12 |
'/': 'static', |
|
13 |
}), |
|
14 |
}) |
|
15 |
||
50
ba9d03e46925
ignore invalid #hash values for cx:cy:zl
Tero Marttila <terom@fixme.fi>
parents:
36
diff
changeset
|
16 |
def main (host='0.0.0.0', port=8000) : |
36 | 17 |
httpd = wsgiref.simple_server.make_server(host, port, app) |
18 |
||
19 |
print "Listening on %s:%d" % (host, port) |
|
20 |
||
21 |
httpd.serve_forever() |
|
22 |
||
23 |
if __name__ == '__main__' : |
|
24 |
main() |
|
25 |