23 lines
486 B
Python
23 lines
486 B
Python
from fastapi import FastAPI
|
|
from fastapi.responses import ORJSONResponse
|
|
|
|
from nyekiapi.lib import settings
|
|
from nyekiapi.api.lifespan import lifespan
|
|
from nyekiapi.api.v2 import app as app_v2
|
|
from nyekiapi.api.v2.errors import NotFoundError
|
|
|
|
|
|
app = FastAPI(
|
|
debug=settings.DEBUG,
|
|
docs_url=None,
|
|
redoc_url=None,
|
|
lifespan=lifespan,
|
|
default_response_class=ORJSONResponse,
|
|
)
|
|
|
|
|
|
app.add_exception_handler(404, NotFoundError.handler)
|
|
|
|
|
|
app.mount("/v2", app_v2, name="v2")
|