Skip to content

Commit 47620c2

Browse files
committed
api v1
1 parent a1243fc commit 47620c2

5 files changed

Lines changed: 28 additions & 0 deletions

File tree

app/api/api_v1/__init__.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
from fastapi import APIRouter
2+
3+
from core.config import settings
4+
from .users import router as users_router
5+
6+
router = APIRouter(
7+
prefix=settings.api_prefix.v1.prefix,
8+
)
9+
10+
router.include_router(
11+
users_router
12+
)

app/api/api_v1/users.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
from fastapi import APIRouter
2+
3+
from core.config import settings
4+
5+
6+
router = APIRouter(
7+
prefix=settings.api_prefix.v1.users,
8+
tags=["Users"],
9+
)
10+

app/core/config.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,14 @@
33
from pydantic_settings import BaseSettings, SettingsConfigDict
44

55

6+
class ApiV1Prefix(BaseModel):
7+
prefix: str = "/v1"
8+
users: str = "/users"
9+
610
class ApiPrefix(BaseModel):
711
prefix: str = "/api"
12+
v1: ApiV1Prefix = ApiV1Prefix()
13+
814

915
class RunConfig(BaseModel):
1016
host: str = "127.0.0.1"

app/core/schemas/__init__.py

Whitespace-only changes.

app/core/schemas/user_schemas.py

Whitespace-only changes.

0 commit comments

Comments
 (0)