auth service completed and tested
This commit is contained in:
5
DockerApiServices/AllApiNeeds/routers/__init__.py
Normal file
5
DockerApiServices/AllApiNeeds/routers/__init__.py
Normal file
@@ -0,0 +1,5 @@
|
||||
from .base_router import test_route
|
||||
|
||||
__all__ = [
|
||||
"test_route"
|
||||
]
|
||||
22
DockerApiServices/AllApiNeeds/routers/base_router.py
Normal file
22
DockerApiServices/AllApiNeeds/routers/base_router.py
Normal file
@@ -0,0 +1,22 @@
|
||||
"""
|
||||
Base router configuration and setup.
|
||||
"""
|
||||
|
||||
from fastapi import APIRouter, Request
|
||||
from middleware.auth_middleware import MiddlewareModule
|
||||
|
||||
# Create test router
|
||||
test_route = APIRouter(prefix="/test", tags=["Test"])
|
||||
|
||||
@test_route.get("/health")
|
||||
@MiddlewareModule.auth_required
|
||||
async def health_check(request: Request):
|
||||
return {"status": "healthy", "message": "Service is running"}
|
||||
|
||||
@test_route.get("/ping")
|
||||
async def ping_test():
|
||||
return {"ping": "pong", "service": "base-router"}
|
||||
|
||||
# Initialize and include test routes
|
||||
def init_test_routes():
|
||||
return test_route
|
||||
Reference in New Issue
Block a user