first commit
This commit is contained in:
commit
6e354ba041
109 changed files with 12110 additions and 0 deletions
31
backend/app/config.py
Normal file
31
backend/app/config.py
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
from pydantic_settings import BaseSettings, SettingsConfigDict
|
||||
|
||||
|
||||
class Settings(BaseSettings):
|
||||
model_config = SettingsConfigDict(env_file=".env", env_file_encoding="utf-8", extra="ignore")
|
||||
|
||||
app_name: str = "Silos API"
|
||||
debug: bool = True
|
||||
|
||||
# SQLite by default for local dev; switch to PostgreSQL in production
|
||||
database_url: str = "sqlite:///./silos.db"
|
||||
|
||||
mongodb_url: str = "mongodb://localhost:27017"
|
||||
mongodb_db: str = "silos"
|
||||
|
||||
secret_key: str = "change-this-to-a-long-random-secret-key-in-production"
|
||||
access_token_expire_minutes: int = 60
|
||||
refresh_token_expire_days: int = 7
|
||||
|
||||
cors_origins: str = "http://localhost:5173,http://127.0.0.1:5173"
|
||||
|
||||
@property
|
||||
def is_sqlite(self) -> bool:
|
||||
return self.database_url.startswith("sqlite")
|
||||
|
||||
@property
|
||||
def cors_origin_list(self) -> list[str]:
|
||||
return [origin.strip() for origin in self.cors_origins.split(",") if origin.strip()]
|
||||
|
||||
|
||||
settings = Settings()
|
||||
Loading…
Add table
Add a link
Reference in a new issue