File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -104,4 +104,8 @@ ${SUDO_BIN} systemctl daemon-reload
104104${SUDO_BIN} systemctl enable --now " ${SERVICE_NAME} .service"
105105${SUDO_BIN} systemctl restart " ${SERVICE_NAME} .service"
106106
107- ${SUDO_BIN} systemctl status " ${SERVICE_NAME} .service" --no-pager
107+ if ! ${SUDO_BIN} systemctl status " ${SERVICE_NAME} .service" --no-pager; then
108+ echo " Service failed to start, showing recent logs:" >&2
109+ ${SUDO_BIN} journalctl -u " ${SERVICE_NAME} .service" -n 50 --no-pager || true
110+ exit 1
111+ fi
Original file line number Diff line number Diff line change 33from pathlib import Path
44
55from fastapi import FastAPI , HTTPException
6- from fastapi .responses import HTMLResponse , JSONResponse , FileResponse
6+ from fastapi .responses import HTMLResponse
77
88BASE_DIR = Path (__file__ ).resolve ().parent .parent
99WEB_DIR = BASE_DIR / "web"
@@ -23,11 +23,14 @@ def _read_html(path: Path) -> str:
2323def read_index () -> str :
2424 """Return the contents of the bundled ``index.html`` file."""
2525
26+ return _read_html (INDEX_PATH )
2627
27- @app .get ("/aladin" )
28- async def aladin () -> FileResponse :
28+
29+ @app .get ("/aladin" , response_class = HTMLResponse )
30+ def read_aladin () -> str :
2931 """Serve the Aladin viewer page."""
30- return FileResponse ("web/aladin.html" )
32+
33+ return _read_html (ALADIN_PATH )
3134
3235if __name__ == "__main__" :
3336 import uvicorn
You can’t perform that action at this time.
0 commit comments