feat: initialisation Hermes Hub — interface multi-univers securisee (FastAPI, proxy async, design tokens)

This commit is contained in:
bolbol
2026-08-19 20:46:08 +01:00
commit d107d40a30
59 changed files with 1538 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
from fastapi import APIRouter, Request, HTTPException
from app.config import UNIVERSES
from app.proxy import proxy_request
router = APIRouter(prefix="/u", tags=["Universe Proxy"])
@router.api_route("/{universe_id}", methods=["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS"])
@router.api_route("/{universe_id}/", methods=["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS"])
@router.api_route("/{universe_id}/{path:path}", methods=["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS"])
async def dynamic_universe_proxy(universe_id: str, request: Request, path: str = ""):
if universe_id not in UNIVERSES:
raise HTTPException(status_code=404, detail=f"Universe '{universe_id}' not found.")
universe = UNIVERSES[universe_id]
return await proxy_request(
request=request,
backend_url=universe.backend_url,
path=path
)