mailpilot / app /main.py
Yadav122's picture
Initial deployment of MailPilot application
7a88b43
raw
history blame
840 Bytes
"""Main FastAPI app instance declaration."""
import fastapi
import structlog
import uvicorn
from app.core.config import settings
from .core.middlewares import add_middlewares
from app.router import api_router
# Set up structlog for logging
logger = structlog.get_logger()
fastapi_app = fastapi.FastAPI(
title=settings.PROJECT_NAME,
version=settings.VERSION,
description=settings.DESCRIPTION,
openapi_url=settings.OPENAPI_URL,
docs_url=settings.DOCS_URL,
)
fastapi_app.include_router(api_router)
add_middlewares(fastapi_app)
# Log the app startup
logger.info(
"Application started", project=settings.PROJECT_NAME, version=settings.VERSION
)
if __name__ == "__main__":
uvicorn.run(
"main:fastapi_app",
host=settings.UVICORN_HOST,
port=settings.UVICORN_PORT,
reload=True,
)