summaryrefslogtreecommitdiffstats
path: root/back/app.py
diff options
context:
space:
mode:
Diffstat (limited to 'back/app.py')
-rw-r--r--back/app.py15
1 files changed, 7 insertions, 8 deletions
diff --git a/back/app.py b/back/app.py
index 7d082d4..0d7bbee 100644
--- a/back/app.py
+++ b/back/app.py
@@ -1,7 +1,7 @@
from __future__ import annotations
from sanic import Sanic
from sanic.response import json as response_json, file
-from config import APP_DIR
+from config import APP_DIR, debug as is_debug
from aioredis import create_redis_pool
from dataclasses import dataclass, fields, asdict
import json
@@ -10,12 +10,11 @@ from math import floor
app = Sanic(__name__)
-app.static("/", APP_DIR + "/../front/index.html")
-app.static("/js/out.js", APP_DIR + "/../front/out.js")
-app.static("/css/style.css", APP_DIR + "/../front/style.css")
-app.static("/css/twemoji-awesome.css", APP_DIR + "/../front/twemoji-awesome.css")
-app.static("/AnkaCoder/", APP_DIR + "/../front/AnkaCoder")
-app.static("/AnkaCoderCondensed/", APP_DIR + "/../front/AnkaCoderCondensed")
+if is_debug:
+ # in release environment, these will be served by nginx
+ # but in debug, we serve this shit directly.
+ # app.static("/", APP_DIR + "/../front/index.html")
+ app.static("/", APP_DIR + "/../front/dist/")
def now_ms() -> int:
@@ -103,4 +102,4 @@ async def get_todos(req):
return response_json({ "todos": todos })
if __name__ == "__main__":
- app.go_fast(host="0.0.0.0", port=8000, debug=True)
+ app.go_fast(host="0.0.0.0", port=8000, debug=is_debug)