|
@@ -9,18 +9,11 @@ cache = storage.Cache()
|
|
|
db = storage.Storage()
|
|
|
|
|
|
|
|
|
-@app.route("/static/<f>")
|
|
|
-async def static(request: sanic.request.Request, f: str) -> sanic.response.Response:
|
|
|
- return await sanic.response.file('static/{}'.format(f))
|
|
|
-
|
|
|
-
|
|
|
-@app.route("/")
|
|
|
-async def index(request: sanic.request.Request) -> sanic.response.Response:
|
|
|
- return await sanic.response.file('static/index.html')
|
|
|
-
|
|
|
+app.static('/static', './static')
|
|
|
+app.static('/', './static/index.html')
|
|
|
|
|
|
@app.websocket("/socket")
|
|
|
-async def socket(request: sanic.request.Request, ws: sanic.websocket.WebSocketConnection) -> sanic.response.Response:
|
|
|
+async def socket(request: sanic.request.Request, ws: sanic.websocket.WebSocketConnection) -> sanic.response.HTTPResponse:
|
|
|
initial = await ws.recv()
|
|
|
config: messages.InitialConfig = messages.Message.decode(initial)
|
|
|
sanic.log.logger.info(
|