api-admim/app/routers/router_registry.py

14 lines
349 B
Python

# app/utils/router_registry.py
from fastapi import FastAPI, APIRouter
from typing import List
class RouterRegistry:
def __init__(self, app: FastAPI, routers: List[APIRouter]):
self.app = app
self.routers = routers
def register_routers(self):
for router in self.routers:
self.app.include_router(router)