forked from mtusi2026/mtusi2026lab2
26 lines
731 B
Python
26 lines
731 B
Python
from fastapi import FastAPI
|
|
from fastapi.exceptions import RequestValidationError
|
|
from fastapi import HTTPException
|
|
|
|
from app.middleware import RequestIdMiddleware
|
|
from app.exceptions import http_exception_handler, validation_exception_handler
|
|
from app.routers import health, users, chats, messages, auth
|
|
|
|
|
|
app = FastAPI(
|
|
title="MTUSI Messenger",
|
|
version="1.1.0",
|
|
)
|
|
|
|
|
|
app.add_middleware(RequestIdMiddleware)
|
|
|
|
app.add_exception_handler(HTTPException, http_exception_handler)
|
|
app.add_exception_handler(RequestValidationError, validation_exception_handler)
|
|
|
|
app.include_router(health.router)
|
|
app.include_router(users.router)
|
|
app.include_router(chats.router)
|
|
app.include_router(messages.router)
|
|
app.include_router(auth.router)
|