feat(services): add authenticated services listing
This commit is contained in:
+6
-4
@@ -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("/")
|
||||
|
||||
Reference in New Issue
Block a user