mirror of
https://github.com/Rainyy21/k3s-health-dashboard.git
synced 2026-10-11 00:40:19 -04:00
23 lines
530 B
Python
23 lines
530 B
Python
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"}
|