first commit
This commit is contained in:
23
backend/config.py
Normal file
23
backend/config.py
Normal file
@@ -0,0 +1,23 @@
|
||||
from pydantic_settings import BaseSettings
|
||||
from typing import List
|
||||
|
||||
|
||||
class Settings(BaseSettings):
|
||||
mongodb_url: str
|
||||
database_name: str = "grademaxxing"
|
||||
secret_key: str
|
||||
algorithm: str = "HS256"
|
||||
access_token_expire_minutes: int = 43200 # 30 days
|
||||
vite_api_url: str = "http://localhost:8000/api"
|
||||
cors_origins: str = "http://localhost:5173,http://localhost:8000,http://127.0.0.1:8000"
|
||||
|
||||
@property
|
||||
def cors_origins_list(self) -> List[str]:
|
||||
return [origin.strip() for origin in self.cors_origins.split(",")]
|
||||
|
||||
class Config:
|
||||
env_file = ".env"
|
||||
case_sensitive = False
|
||||
|
||||
|
||||
settings = Settings()
|
||||
Reference in New Issue
Block a user