Team13.4 / api /inference /router.py
Xmaster6y's picture
initial setup
ab8b5a4
raw
history blame
613 Bytes
"""
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 inference router...")
yield
logger.info("Shutting down inference router...")
router = APIRouter(
lifespan=lifespan,
)
@router.get(
"/",
status_code=200,
response_model=SuccessDetail,
)
async def home():
"""
Submodule home page.
"""
return {"success": "Welcome to the inference submodule!"}