Automated Action 3efcd88ffa Create Calculator API with FastAPI and SQLAlchemy
- Setup FastAPI project structure
- Add database models for calculations
- Create API endpoints for basic math operations
- Add health endpoint
- Configure SQLite and Alembic for database management
- Update README with usage instructions

generated with BackendIM... (backend.im)
2025-05-13 22:57:26 +00:00

17 lines
449 B
Python

from pathlib import Path
from pydantic_settings import BaseSettings
class Settings(BaseSettings):
API_V1_STR: str = "/api/v1"
PROJECT_NAME: str = "Calculator API"
# Database settings
DB_DIR = Path("/app") / "storage" / "db"
DB_DIR.mkdir(parents=True, exist_ok=True)
DATABASE_URL: str = f"sqlite:///{DB_DIR}/db.sqlite"
class Config:
env_file = ".env"
case_sensitive = True
settings = Settings()