botWebWars/backend/app/config.py

31 lines
771 B
Python

import os
from pathlib import Path
from pydantic_settings import BaseSettings, SettingsConfigDict
class Settings(BaseSettings):
model_config = SettingsConfigDict(env_prefix="BOTWEBWARS_")
APP_NAME: str = "botWebWars"
DEBUG: bool = False
# Board coordinates: 64x64 grid with coordinates from (0,0) to (64,64)
GRID_MIN_X: int = 0
GRID_MAX_X: int = 64
GRID_MIN_Y: int = 0
GRID_MAX_Y: int = 64
# Max players before rejection or wrapping
MAX_PLAYERS: int = 4096
# Static files directory for frontend
FRONTEND_DIR: Path = Path(
os.getenv(
"BOTWEBWARS_FRONTEND_DIR",
str(Path(__file__).resolve().parent.parent.parent / "frontend" / "dist")
)
)
settings = Settings()