move host, port and debug to server run function make .env variables writen in CAPS

This commit is contained in:
2024-04-13 01:22:54 +02:00
parent 4b179bc452
commit 0027476c4e
2 changed files with 11 additions and 13 deletions
+7 -7
View File
@@ -22,16 +22,16 @@ import os
if __name__ == "__main__":
load_dotenv(find_dotenv())
SNAKE = SnakeBuilder.build(os.environ.get("snake", "DummSnake"))
server = Server(
data_path=os.path.dirname(__file__),
snake=SnakeBuilder.build(os.environ.get("snake", "DummSnake")),
port=int(os.environ.get("PORT", "8000")),
debug=bool(os.environ.get("debug", False)),
snake=SnakeBuilder.build(os.environ.get("SNAKE", "DummSnake")),
)
if os.environ.get("store_game", None):
if os.environ.get("STORE_GAME_HISTORY", None):
server.enable_store_game_state()
server.run()
server.run(
host=os.environ.get("HOST", "0.0.0.0"),
port=int(os.environ.get("PORT", "8000")),
debug=bool(os.environ.get("DEBUG", False))
)