feat: add version display to frontend and /api/version endpoint (v1.2.5)
- Add GET /api/version endpoint that reads VERSION file - Frontend fetches version on init and displays it as a badge in the header - Add version-badge CSS styling - Update docker-compose.yml comment to v1.2.5
This commit is contained in:
@@ -134,6 +134,12 @@ async def metrics():
|
||||
return Response(content=prometheus_metrics(), media_type="text/plain")
|
||||
|
||||
|
||||
@app.get("/api/version")
|
||||
async def version():
|
||||
version_file = Path(__file__).parent.parent / "VERSION"
|
||||
return {"version": version_file.read_text().strip() if version_file.exists() else "unknown"}
|
||||
|
||||
|
||||
frontend_dir = Path(__file__).parent / "frontend"
|
||||
app.mount("/", StaticFiles(directory=frontend_dir, html=True), name="frontend")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user