fix: add back DB init endpoints, ref NOISSUE

This commit is contained in:
2026-04-04 23:34:29 +02:00
parent 08af3ed38d
commit 5eb5bd426a
2 changed files with 25 additions and 11 deletions

View File

@@ -13,6 +13,7 @@ The NiceGUI frontend provides:
import frontend
from fastapi import FastAPI
from database import init_db
app = FastAPI()
@@ -23,6 +24,13 @@ def read_root():
return {'Hello': 'World'}
@app.post('/init-db')
def initialize_database():
"""Initialize database tables (POST endpoint for NiceGUI to call before dashboard)."""
init_db()
return {'message': 'Database initialized successfully'}
frontend.init(app)
if __name__ == '__main__':