Commit 34ed0ffb authored by wanli's avatar wanli

update

parent c15e3201
''' '''
Author: your name Author: your name
Date: 2021-04-14 14:12:18 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 LastEditors: Please set LastEditors
Description: In User Settings Edit Description: In User Settings Edit
FilePath: \evm-store\backend\start.py FilePath: \evm-store\backend\start.py
...@@ -11,6 +11,7 @@ FilePath: \evm-store\backend\start.py ...@@ -11,6 +11,7 @@ FilePath: \evm-store\backend\start.py
import sys import sys
import os import os
import signal import signal
import json
# import tornado.autoreload # import tornado.autoreload
from tornado.wsgi import WSGIContainer from tornado.wsgi import WSGIContainer
from tornado.web import Application, RequestHandler, FallbackHandler from tornado.web import Application, RequestHandler, FallbackHandler
...@@ -26,9 +27,7 @@ class GracefulExit(SystemExit): ...@@ -26,9 +27,7 @@ class GracefulExit(SystemExit):
class VueHandler(RequestHandler): class VueHandler(RequestHandler):
def get(self): def get(self):
remote_ip = self.request.remote_ip self.write(json.dumps({ 'code': 200, 'msg': 'success', 'data': self.request.remote_ip }))
logger.info("remote_ip %s" % remote_ip)
self.render("index.html")
def raise_graceful_exit(*args): def raise_graceful_exit(*args):
IOLoop.current().stop() IOLoop.current().stop()
...@@ -36,17 +35,16 @@ def raise_graceful_exit(*args): ...@@ -36,17 +35,16 @@ def raise_graceful_exit(*args):
raise GracefulExit() raise GracefulExit()
def start(): def start():
settings = { # settings = {
'debug': config['DEBUG'], # 'debug': config['DEBUG'],
'template_path': config['TEMPLATE_PATH'], # 'template_path': config['TEMPLATE_PATH'],
'static_path': config['STATIC_PATH'], # 'static_path': config['STATIC_PATH'],
'static_url_path': '', # 'static_url_path': '',
} # }
watch(os.sep.join([os.getcwd(), "restart.json"])) watch(os.sep.join([os.getcwd(), "restart.json"]))
wsgi_app = WSGIContainer(app) wsgi_app = WSGIContainer(app)
application = Application([ application = Application([
(r'/', VueHandler), (r'/', VueHandler),
(r'/index', VueHandler),
(r"/api/v1/evm_store/monitor", DeviceMessageHandler), (r"/api/v1/evm_store/monitor", DeviceMessageHandler),
(r"/api/v1/evm_store/watch", WatchHandler), (r"/api/v1/evm_store/watch", WatchHandler),
(r"/ws/v1/notify", NotifyHandler), (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