30 lines
642 B
Python
30 lines
642 B
Python
#coding utf8
|
|
#!/usr/bin/python3
|
|
|
|
import os
|
|
import json
|
|
import tornado.ioloop
|
|
import tornado.web
|
|
|
|
class SelfCheckingHandler(tornado.web.RequestHandler):
|
|
|
|
def get(self):
|
|
self.write(json.dumps({
|
|
'errcode': 0,
|
|
'errmsg': '',
|
|
'healthy': 1,
|
|
'max_rundelay': 10
|
|
}))
|
|
|
|
def make_app():
|
|
return tornado.web.Application([
|
|
(r"/webapp/index[\.]php", SelfCheckingHandler),
|
|
])
|
|
|
|
if __name__ == "__main__":
|
|
conf = json.loads(open('config/kefu_redissave.json', 'r').read())
|
|
|
|
app = make_app()
|
|
app.listen(conf['listen_port'])
|
|
tornado.ioloop.IOLoop.current().start()
|