mirror of
https://gitlab.com/MoonTestUse1/AdministrationItDepartmens.git
synced 2025-08-14 00:25:46 +02:00
26 lines
908 B
Python
26 lines
908 B
Python
"""Main application module"""
|
||
from fastapi import FastAPI
|
||
from fastapi.middleware.cors import CORSMiddleware
|
||
from . import models
|
||
from .routers import admin, employees, requests, auth, statistics
|
||
|
||
app = FastAPI(
|
||
# Отключаем автоматическое перенаправление со слэшем
|
||
redirect_slashes=False
|
||
)
|
||
|
||
# CORS configuration
|
||
app.add_middleware(
|
||
CORSMiddleware,
|
||
allow_origins=["*"],
|
||
allow_credentials=True,
|
||
allow_methods=["*"],
|
||
allow_headers=["*"],
|
||
)
|
||
|
||
# Include routers
|
||
app.include_router(auth.router, prefix="/auth", tags=["auth"])
|
||
app.include_router(admin.router, prefix="/api/admin", tags=["admin"])
|
||
app.include_router(employees.router, prefix="/api/employees", tags=["employees"])
|
||
app.include_router(requests.router, prefix="/api/requests", tags=["requests"])
|
||
app.include_router(statistics.router, prefix="/api/statistics", tags=["statistics"]) |