We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7a8357f commit dd48e01Copy full SHA for dd48e01
3 files changed
api_v1/__init__.py
@@ -0,0 +1,3 @@
1
+from .routers import router
2
+
3
+__all__ = ('router',)
api_v1/routers.py
@@ -0,0 +1,4 @@
+from fastapi import APIRouter
4
+router = APIRouter(prefix='/api/v1')
main.py
@@ -1,6 +1,7 @@
from contextlib import asynccontextmanager
from fastapi import FastAPI
from config import db_connection, BaseModel
+from api_v1 import router
5
6
7
@asynccontextmanager
@@ -12,3 +13,4 @@ async def lifespan(app: FastAPI):
12
13
14
15
app = FastAPI(lifespan=lifespan)
16
+app.include_router(router=router)
0 commit comments