feat: Add environment configuration files and update settings for production and development
Some checks failed
Backend CI / lint (push) Failing after 5m0s
Backend CI / test (push) Successful in 3m39s

This commit is contained in:
JSC
2025-08-09 14:43:20 +02:00
parent 69544b6bb8
commit 734521c5c3
9 changed files with 202 additions and 11 deletions

View File

@@ -6,6 +6,7 @@ from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from app.api import api_router
from app.core.config import settings
from app.core.database import get_session_factory, init_db
from app.core.logging import get_logger, setup_logging
from app.middleware.logging import LoggingMiddleware
@@ -47,12 +48,21 @@ async def lifespan(_app: FastAPI) -> AsyncGenerator[None, None]:
def create_app() -> FastAPI:
"""Create and configure the FastAPI application."""
app = FastAPI(lifespan=lifespan)
app = FastAPI(
title="Soundboard API",
description="API for the Soundboard application with authentication, sound management, and real-time features",
version="1.0.0",
lifespan=lifespan,
# Configure docs URLs for reverse proxy setup
docs_url="/api/docs", # Swagger UI at /api/docs
redoc_url="/api/redoc", # ReDoc at /api/redoc
openapi_url="/api/openapi.json" # OpenAPI schema at /api/openapi.json
)
# Add CORS middleware
app.add_middleware(
CORSMiddleware,
allow_origins=["http://localhost:8001"],
allow_origins=settings.CORS_ORIGINS,
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],