refactor: extract all routes to app/api/v1/endpoints/ with proper structure
This commit is contained in:
26
app/api/v1/router.py
Normal file
26
app/api/v1/router.py
Normal file
@@ -0,0 +1,26 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
LogBoard+ - API Router
|
||||
Автор: Сергей Антропов
|
||||
Сайт: https://devops.org.ru
|
||||
"""
|
||||
|
||||
from fastapi import APIRouter
|
||||
|
||||
from .endpoints import auth, logs, containers, websocket, pages
|
||||
|
||||
# Создаем основной роутер API v1
|
||||
api_router = APIRouter(prefix="/api", tags=["api"])
|
||||
|
||||
# Подключаем маршруты страниц (без префикса /api)
|
||||
pages_router = APIRouter(tags=["pages"])
|
||||
|
||||
# Подключаем все маршруты
|
||||
api_router.include_router(auth.router, prefix="/auth", tags=["auth"])
|
||||
api_router.include_router(logs.router, prefix="/logs", tags=["logs"])
|
||||
api_router.include_router(containers.router, prefix="/containers", tags=["containers"])
|
||||
api_router.include_router(websocket.router, prefix="/websocket", tags=["websocket"])
|
||||
|
||||
# Подключаем маршруты страниц
|
||||
pages_router.include_router(pages.router)
|
||||
Reference in New Issue
Block a user