2025-05-16 22:52:11 +00:00

26 lines
723 B
Python

import uvicorn
from fastapi import FastAPI
from app.api.routes import health, items
from app.core.config import settings
from app.db.session import engine
from app.models.base import Base
# Create database tables
Base.metadata.create_all(bind=engine)
app = FastAPI(
title=settings.PROJECT_NAME,
description=settings.PROJECT_DESCRIPTION,
version=settings.VERSION,
openapi_url=f"{settings.API_V1_STR}/openapi.json",
docs_url="/docs",
redoc_url="/redoc",
)
# Include routers
app.include_router(health.router, tags=["health"])
app.include_router(items.router, prefix=settings.API_V1_STR, tags=["items"])
if __name__ == "__main__":
uvicorn.run("main:app", host="0.0.0.0", port=8000, reload=True)