mirror of
https://gitlab.com/MoonTestUse1/AdministrationItDepartmens.git
synced 2025-08-14 00:25:46 +02:00
9
This commit is contained in:
@@ -5,6 +5,8 @@ from fastapi.openapi.utils import get_openapi
|
||||
import logging
|
||||
from logging.config import dictConfig
|
||||
from .logging_config import logging_config
|
||||
from .middleware import LoggingMiddleware
|
||||
from .routers import auth
|
||||
|
||||
# Configure logging
|
||||
dictConfig(logging_config)
|
||||
@@ -18,6 +20,21 @@ app = FastAPI(
|
||||
redoc_url=None
|
||||
)
|
||||
|
||||
# Add CORS middleware
|
||||
app.add_middleware(
|
||||
CORSMiddleware,
|
||||
allow_origins=["*"],
|
||||
allow_credentials=True,
|
||||
allow_methods=["*"],
|
||||
allow_headers=["*"],
|
||||
)
|
||||
|
||||
# Add logging middleware
|
||||
app.add_middleware(LoggingMiddleware)
|
||||
|
||||
# Include routers
|
||||
app.include_router(auth.router, prefix="/api/auth", tags=["auth"])
|
||||
|
||||
# Custom OpenAPI documentation
|
||||
@app.get("/api/docs", include_in_schema=False)
|
||||
async def custom_swagger_ui_html():
|
||||
@@ -34,6 +51,4 @@ async def get_open_api_endpoint():
|
||||
version="1.0.0",
|
||||
description="API for managing support requests and employees",
|
||||
routes=app.routes
|
||||
)
|
||||
|
||||
# Existing middleware and routes...
|
||||
)
|
||||
Reference in New Issue
Block a user