redis implemntations and api setup completed
This commit is contained in:
31
DockerApiServices/AuthServiceApi/create_routes.py
Normal file
31
DockerApiServices/AuthServiceApi/create_routes.py
Normal file
@@ -0,0 +1,31 @@
|
||||
"""
|
||||
Route configuration and factory module.
|
||||
Handles dynamic route creation based on configurations.
|
||||
"""
|
||||
|
||||
from fastapi import Request
|
||||
from Events.Engine.set_defaults.setClusters import PrepareRouting
|
||||
|
||||
|
||||
async def health_check(request: Request):
|
||||
"""Default health check endpoint."""
|
||||
return {"status": "healthy", "message": "Service is running"}
|
||||
|
||||
|
||||
async def ping_test(request: Request, service_name: str = "base-router"):
|
||||
"""Default ping test endpoint."""
|
||||
return {"ping": "pong", "service": service_name}
|
||||
|
||||
|
||||
def get_all_routers() -> PrepareRouting:
|
||||
"""
|
||||
Get all routers and protected routes from route configurations.
|
||||
|
||||
Returns:
|
||||
tuple: (routers, protected_routes)
|
||||
"""
|
||||
from Events.Engine.set_defaults.run import get_cluster_controller_group
|
||||
|
||||
cluster_list = get_cluster_controller_group()
|
||||
prepare_routing = PrepareRouting(cluster_controller_group=cluster_list)
|
||||
return prepare_routing
|
||||
Reference in New Issue
Block a user