""" Generate router """ import logging from contextlib import asynccontextmanager from fastapi import APIRouter from api.schema import SuccessDetail @asynccontextmanager async def lifespan(app: APIRouter): logger = logging.getLogger("uvicorn") logger.info("Starting requirements router...") yield logger.info("Shutting down requirements router...") router = APIRouter( lifespan=lifespan, ) @router.get( "/", status_code=200, response_model=SuccessDetail, ) async def home(): """ Submodule home page. """ return {"success": "Welcome to the requirements submodule!"}