Skip to content

Commit 591b70f

Browse files
committed
Another one fix the wall
1 parent c54c6d0 commit 591b70f

2 files changed

Lines changed: 12 additions & 5 deletions

File tree

deploy/deploy.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff 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

src/server.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from pathlib import Path
44

55
from fastapi import FastAPI, HTTPException
6-
from fastapi.responses import HTMLResponse, JSONResponse, FileResponse
6+
from fastapi.responses import HTMLResponse
77

88
BASE_DIR = Path(__file__).resolve().parent.parent
99
WEB_DIR = BASE_DIR / "web"
@@ -23,11 +23,14 @@ def _read_html(path: Path) -> str:
2323
def 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

3235
if __name__ == "__main__":
3336
import uvicorn

0 commit comments

Comments
 (0)