forked from toop/TopBI
-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.py
28 lines (22 loc) · 750 Bytes
/
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# -*- coding: UTF-8 -*-
from wheezy.http import WSGIApplication
from wheezy.http.middleware import http_cache_middleware_factory
from wheezy.web.middleware import bootstrap_defaults
from wheezy.web.middleware import path_routing_middleware_factory
from config import options
from urls import all_urls
from database import init_db
init_db()
main = WSGIApplication([
bootstrap_defaults(url_mapping=all_urls),
http_cache_middleware_factory,
path_routing_middleware_factory
], options)
if __name__ == '__main__':
from wsgiref.simple_server import make_server
try:
print('Visit http://localhost:8080/')
make_server('', 8080, main).serve_forever()
except KeyboardInterrupt:
pass
print('\nThanks!')