fix: serve data/ from disk via nginx alias; return full athlete data from API

This commit is contained in:
Davide Scaini
2026-04-10 15:57:23 +02:00
parent ae883a7dba
commit 96a3deee5d
2 changed files with 10 additions and 8 deletions
+1 -8
View File
@@ -463,14 +463,7 @@ async def get_athlete(bincio_session: Optional[str] = Cookie(default=None)) -> J
data[k] = edits[k]
except Exception:
pass
return JSONResponse({
"max_hr": data.get("max_hr"),
"ftp_w": data.get("ftp_w"),
"hr_zones": data.get("hr_zones"),
"power_zones": data.get("power_zones"),
"seasons": data.get("seasons", []),
"gear": data.get("gear", {}),
})
return JSONResponse(data)
@app.post("/api/athlete")
+9
View File
@@ -236,6 +236,8 @@ server {
root /var/www/bincio;
index index.html;
client_max_body_size 512M; # bulk activity uploads
# API → bincio serve
location /api/ {
proxy_pass http://127.0.0.1:4041;
@@ -244,6 +246,13 @@ server {
proxy_read_timeout 120s; # Strava sync can be slow
}
# Data files served live from disk — bypasses the build/rsync cycle
# so uploads and merges are visible immediately without a site rebuild.
location /data/ {
alias /var/bincio/data/;
add_header Cache-Control "no-cache, must-revalidate";
}
# Static files
location / {
try_files $uri $uri/ $uri.html =404;