feat(services): add authenticated services listing

This commit is contained in:
2026-05-04 17:02:43 +02:00 Unverified
parent 7b540cd0b5
commit daf7894f27
3 changed files with 20 additions and 4 deletions
+6 -4
View File
@@ -7,6 +7,7 @@ from fastapi import FastAPI
from api.auth.router import router as auth_router
from api.proxy.router import router as proxy_router
from api.services.router import router as services_router
from core.config import settings
from core.mongodb import close_mongodb, init_mongodb
from core.redis import close_redis, init_redis
@@ -31,10 +32,10 @@ async def lifespan(_: FastAPI):
app.state.services = get_all_services(home_dir) or []
if not app.state.services:
warning = (
"\n" + "!" * 60 + "\n"
" WARNING: No services found in home directory!\n"
f" Scanned: {home_dir}\n"
+ "!" * 60 + "\n"
"\n" + "!" * 60 + "\n"
" WARNING: No services found in home directory!\n"
f" Scanned: {home_dir}\n"
+ "!" * 60 + "\n"
)
print(warning, file=sys.stderr)
@@ -57,6 +58,7 @@ app = FastAPI(
app.include_router(auth_router)
app.include_router(proxy_router)
app.include_router(services_router)
@app.get("/")