Skip to content

Commit

Permalink
Wrap routers in folders & rename files
Browse files Browse the repository at this point in the history
  • Loading branch information
IbraheemTuffaha committed Aug 31, 2024
1 parent 19719b8 commit 82a454b
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 12 deletions.
4 changes: 2 additions & 2 deletions app/main.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
from fastapi import FastAPI
from fastapi.responses import RedirectResponse

from app.v1.routers import router as v1_router
from app.v1.routers import base_router as v1_router


app = FastAPI()

app.include_router(v1_router)
app.include_router(v1_router.router)


@app.get("/up")
Expand Down
3 changes: 0 additions & 3 deletions app/v1/routers/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
__all__ = ["router"]

from app.v1.routers.base import router
7 changes: 0 additions & 7 deletions app/v1/routers/base.py

This file was deleted.

7 changes: 7 additions & 0 deletions app/v1/routers/base_router.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
from fastapi import APIRouter

from app.v1.routers.users import users_router


router = APIRouter(prefix="/v1")
router.include_router(users_router.router, prefix="/users", tags=["Users"])
Empty file.
File renamed without changes.

0 comments on commit 82a454b

Please sign in to comment.