diff options
author | syn <isaqtm@gmail.com> | 2021-03-10 13:51:09 +0300 |
---|---|---|
committer | syn <isaqtm@gmail.com> | 2021-03-10 13:51:50 +0300 |
commit | fed1685bde8fe5ca24cb9d248b2efd0eb6115d30 (patch) | |
tree | 7fd9608356a9b97498cf35bbbd77d8cbfda131c0 /back | |
parent | b2330e3457abb2671ac46738c999b8c7432e0200 (diff) | |
download | upnet-fed1685bde8fe5ca24cb9d248b2efd0eb6115d30.tar.gz |
extract host+port to config
Diffstat (limited to 'back')
-rw-r--r-- | back/app.py | 4 | ||||
-rw-r--r-- | back/config.py | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/back/app.py b/back/app.py index 2b8cf6f..7aa4607 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, debug as is_debug +from config import APP_DIR, debug as is_debug, sanic_host, sanic_port from aioredis import create_redis_pool from dataclasses import dataclass, fields, asdict import json @@ -109,4 +109,4 @@ async def get_todos(req): if __name__ == "__main__": - app.go_fast(host="0.0.0.0", port=8000, debug=is_debug) + app.go_fast(host=sanic_host, port=sanic_port, debug=is_debug) diff --git a/back/config.py b/back/config.py index 367e24f..6fbfd95 100644 --- a/back/config.py +++ b/back/config.py @@ -12,3 +12,6 @@ APP_DIR = os.path.realpath(os.path.dirname(modpath)) REDIS_HOST = "localhost" debug = True + +sanic_host = "localhost" +sanic_port = 8001 |