-
Notifications
You must be signed in to change notification settings - Fork 2
/
app_main.py
36 lines (27 loc) · 949 Bytes
/
app_main.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
29
30
31
32
33
34
35
36
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import tornado.ioloop
import tornado.web
from tornado.options import define, options
from main_handler import MainHandler
from result_handler import ResultHandler
from item_module import ItemModule
from login_handle import LoginHandler
from reg_handle import RegisterHandler
define("port", default=8000, help="run on the given port", type=int)
def make_app():
return tornado.web.Application([
(r"/", MainHandler),
(r'/s', ResultHandler),
(r'/login', LoginHandler),
(r'/reg', RegisterHandler)
],
template_path=os.path.join(os.path.dirname(__file__), "templates"),
static_path=os.path.join(os.path.dirname(__file__), "static"),
ui_modules={'Item': ItemModule})
if __name__ == "__main__":
tornado.options.parse_command_line()
app = make_app()
app.listen(options.port)
tornado.ioloop.IOLoop.current().start()