Serve the admin panel at its own unlinked /admin page
Moves the fee_address/bet_amount_sats config form out of the main test UI into a dedicated admin.html, served by a GET /admin route (registered ahead of the StaticFiles mount so it doesn't shadow the existing GET/PUT /admin/config API). Deliberately not linked from the test UI in either direction: reachable only by knowing the URL. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
41863691a0
commit
a6dbe48457
3 files changed
+99
-62
No files matched your search
@@ -2,6 +2,7 @@ import asyncio
|
||||
from contextlib import asynccontextmanager
|
||||
|
||||
from fastapi import FastAPI
|
||||
from fastapi.responses import FileResponse
|
||||
from fastapi.staticfiles import StaticFiles
|
||||
|
||||
import app.bets.confirmation # noqa: F401 (registers the "bet" confirmation handler)
|
||||
@@ -64,4 +65,9 @@ async def health() -> dict[str, str]:
|
||||
return {"status": "ok"}
|
||||
|
||||
|
||||
@app.get("/admin", include_in_schema=False)
|
||||
async def admin_panel() -> FileResponse:
|
||||
return FileResponse("app/static/admin.html")
|
||||
|
||||
|
||||
app.mount("/", StaticFiles(directory="app/static", html=True), name="static")
|
||||
Reference in new issue
Block a user