Commit 34ed0ffb authored by wanli's avatar wanli

update

parent c15e3201
'''
Author: your name
Date: 2021-04-14 14:12:18
LastEditTime: 2021-07-01 00:06:01
LastEditTime: 2021-07-01 15:36:09
LastEditors: Please set LastEditors
Description: In User Settings Edit
FilePath: \evm-store\backend\start.py
......@@ -11,6 +11,7 @@ FilePath: \evm-store\backend\start.py
import sys
import os
import signal
import json
# import tornado.autoreload
from tornado.wsgi import WSGIContainer
from tornado.web import Application, RequestHandler, FallbackHandler
......@@ -26,9 +27,7 @@ class GracefulExit(SystemExit):
class VueHandler(RequestHandler):
def get(self):
remote_ip = self.request.remote_ip
logger.info("remote_ip %s" % remote_ip)
self.render("index.html")
self.write(json.dumps({ 'code': 200, 'msg': 'success', 'data': self.request.remote_ip }))
def raise_graceful_exit(*args):
IOLoop.current().stop()
......@@ -36,17 +35,16 @@ def raise_graceful_exit(*args):
raise GracefulExit()
def start():
settings = {
'debug': config['DEBUG'],
'template_path': config['TEMPLATE_PATH'],
'static_path': config['STATIC_PATH'],
'static_url_path': '',
}
# settings = {
# 'debug': config['DEBUG'],
# 'template_path': config['TEMPLATE_PATH'],
# 'static_path': config['STATIC_PATH'],
# 'static_url_path': '',
# }
watch(os.sep.join([os.getcwd(), "restart.json"]))
wsgi_app = WSGIContainer(app)
application = Application([
(r'/', VueHandler),
(r'/index', VueHandler),
(r"/api/v1/evm_store/monitor", DeviceMessageHandler),
(r"/api/v1/evm_store/watch", WatchHandler),
(r"/ws/v1/notify", NotifyHandler),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment