Spaces:
Sleeping
Sleeping
File size: 640 Bytes
6fadbbc |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
import controllers
from fastapi import FastAPI
from fastapi_router_controller import Controller, ControllersTags
from utils.config import Config
from utils.middleware import LogIncomingRequest
from utils.middleware.request_cancellation import RequestCancellation
#########################################
#### Configure the main application #####
#########################################
app = FastAPI(
title='{}'.format(Config.read('app', 'name')),
openapi_tags=ControllersTags)
app.add_middleware(LogIncomingRequest)
app.add_middleware(RequestCancellation)
for router in Controller.routers():
app.include_router(router)
|