mirror of
https://github.com/Rainyy21/k3s-health-dashboard.git
synced 2026-10-11 00:40:19 -04:00
finish the main code
This commit is contained in:
+22
@@ -0,0 +1,22 @@
|
||||
from fastapi import FastAPI
|
||||
from fastapi.staticfiles import StaticFiles
|
||||
from fastapi.responses import FileResponse
|
||||
from app.routers import nodes, pods, metrics
|
||||
|
||||
app = FastAPI(title="k3s Health Dashboard")
|
||||
|
||||
app.include_router(nodes.router)
|
||||
app.include_router(pods.router)
|
||||
app.include_router(metrics.router)
|
||||
|
||||
app.mount("/static", StaticFiles(directory="dashboard/static"), name="static")
|
||||
|
||||
|
||||
@app.get("/")
|
||||
def serve_ui():
|
||||
return FileResponse("dashboard/index.html")
|
||||
|
||||
|
||||
@app.get("/health")
|
||||
def health():
|
||||
return {"status": "ok"}
|
||||
Reference in New Issue
Block a user