-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
executable file
·33 lines (28 loc) · 1.04 KB
/
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
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import os
import tornado
import logging
from tornado.web import HostMatches
from uploader import Uploader
from check import Check
from settings import APP_PORT
logging.basicConfig(format="%(asctime)s:%(levelname)s:%(message)s", level=logging.DEBUG)
def main():
os.chdir(os.path.dirname(os.path.abspath(__file__)))
app = tornado.web.Application([
#(HostMatches("up.illusion.jp"),[("/koikatu_upload/chara/master/unity/koikatu_getChara.php", Uploader)]),
#(HostMatches("www.illusion.jp"),[("/check/koikatu/check.php", Check)])
(HostMatches("up.illusion.jp"),[(".*", Uploader)]),
(HostMatches("www.illusion.jp"),[(".*", Check)])
# ("/koikatu_upload/chara/master/unity/koikatu_getChara.php", Uploader),
# (".*", Check)
])
app.listen(APP_PORT)
try:
logging.info("server is up.")
tornado.ioloop.IOLoop.current().start()
except (KeyboardInterrupt, SystemExit):
logging.info("interrupted.")
if __name__=='__main__':
main()