add dotenv and remove typing and change to inbuild dict
This commit is contained in:
+3
-4
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user