diff --git a/api/kiwi_vpn_api/main.py b/api/kiwi_vpn_api/main.py index 399ce0f..82c2fa8 100755 --- a/api/kiwi_vpn_api/main.py +++ b/api/kiwi_vpn_api/main.py @@ -15,13 +15,12 @@ from fastapi import FastAPI from .config import Config, Settings from .db import Connection from .db.schemas import User -from .routers import admin, dn, user +from .routers import main_router settings = Settings.get() -app = FastAPI() -api = FastAPI( +app = FastAPI( title="kiwi-vpn API", description="This API enables the `kiwi-vpn` service.", contact={ @@ -37,11 +36,7 @@ api = FastAPI( redoc_url=settings.redoc_url if not settings.production_mode else None, ) -api.include_router(admin.router) -api.include_router(user.router) -api.include_router(dn.router) - -app.mount("/api", api) +app.include_router(main_router) @app.on_event("startup") diff --git a/api/kiwi_vpn_api/routers/__init__.py b/api/kiwi_vpn_api/routers/__init__.py index e69de29..22bb142 100644 --- a/api/kiwi_vpn_api/routers/__init__.py +++ b/api/kiwi_vpn_api/routers/__init__.py @@ -0,0 +1,10 @@ +from fastapi import APIRouter + +from . import admin, user + +main_router = APIRouter(prefix="/api/v1") + +main_router.include_router(admin.router) +main_router.include_router(user.router) + +__all__ = ["main_router"]