44 lines
699 B
Python
44 lines
699 B
Python
from fastapi import FastAPI
|
|
|
|
from app.config.settings import settings
|
|
from app.lifespan import lifespan
|
|
|
|
from app.routers.text_moderation_router import (
|
|
router as moderation_router
|
|
)
|
|
|
|
from app.routers.image_moderation_router import (
|
|
router as image_router
|
|
)
|
|
|
|
|
|
from app.exceptions.handlers import (
|
|
invalid_text_exception_handler
|
|
)
|
|
|
|
from app.exceptions.invalid_text_exception import (
|
|
InvalidTextException
|
|
)
|
|
|
|
|
|
app = FastAPI(
|
|
title=settings.APP_NAME,
|
|
version=settings.APP_VERSION,
|
|
lifespan=lifespan
|
|
)
|
|
|
|
|
|
app.include_router(
|
|
moderation_router
|
|
)
|
|
|
|
|
|
app.include_router(
|
|
image_router
|
|
)
|
|
|
|
|
|
app.add_exception_handler(
|
|
InvalidTextException,
|
|
invalid_text_exception_handler
|
|
) |