add dotenv and remove typing and change to inbuild dict

This commit is contained in:
2024-04-12 23:21:12 +02:00
parent b00de3fc56
commit 4173544d08
3 changed files with 11 additions and 9 deletions
+3 -4
View File
@@ -1,12 +1,10 @@
import logging
import os
import typing
from config import DEBUG
from flask import Flask
from flask import request
def run_server(handlers: typing.Dict):
def run_server(handlers:dict):
app = Flask("Battlesnake")
@app.get("/")
@@ -39,8 +37,9 @@ def run_server(handlers: typing.Dict):
host = "0.0.0.0"
port = int(os.environ.get("PORT", "8000"))
debug = bool(os.environ.get("debug", False))
logging.getLogger("werkzeug").setLevel(logging.ERROR)
print(f"\nRunning Battlesnake at http://{host}:{port}")
app.run(host=host, port=port, debug=DEBUG)
app.run(host=host, port=port, debug=debug)