29 lines
701 B
Python
29 lines
701 B
Python
from pathlib import Path
|
|
from typing import List
|
|
|
|
from pydantic_settings import BaseSettings
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
API_V1_STR: str = "/api/v1"
|
|
PROJECT_NAME: str = "E-Commerce API"
|
|
|
|
# Security
|
|
SECRET_KEY: str = "supersecretkey" # In production, use a secure random string
|
|
ALGORITHM: str = "HS256"
|
|
ACCESS_TOKEN_EXPIRE_MINUTES: int = 30
|
|
|
|
# CORS
|
|
CORS_ORIGINS: List[str] = ["http://localhost:3000", "http://localhost:8000"]
|
|
|
|
# Database
|
|
DB_DIR = Path("/app/storage/db")
|
|
DB_DIR.mkdir(parents=True, exist_ok=True)
|
|
SQLALCHEMY_DATABASE_URL: str = f"sqlite:///{DB_DIR}/db.sqlite"
|
|
|
|
class Config:
|
|
case_sensitive = True
|
|
|
|
|
|
settings = Settings()
|