fix: serve data/ from disk via nginx alias; return full athlete data from API
This commit is contained in:
@@ -463,14 +463,7 @@ async def get_athlete(bincio_session: Optional[str] = Cookie(default=None)) -> J
|
|||||||
data[k] = edits[k]
|
data[k] = edits[k]
|
||||||
except Exception:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
return JSONResponse({
|
return JSONResponse(data)
|
||||||
"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", {}),
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
@app.post("/api/athlete")
|
@app.post("/api/athlete")
|
||||||
|
|||||||
@@ -236,6 +236,8 @@ server {
|
|||||||
root /var/www/bincio;
|
root /var/www/bincio;
|
||||||
index index.html;
|
index index.html;
|
||||||
|
|
||||||
|
client_max_body_size 512M; # bulk activity uploads
|
||||||
|
|
||||||
# API → bincio serve
|
# API → bincio serve
|
||||||
location /api/ {
|
location /api/ {
|
||||||
proxy_pass http://127.0.0.1:4041;
|
proxy_pass http://127.0.0.1:4041;
|
||||||
@@ -244,6 +246,13 @@ server {
|
|||||||
proxy_read_timeout 120s; # Strava sync can be slow
|
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
|
# Static files
|
||||||
location / {
|
location / {
|
||||||
try_files $uri $uri/ $uri.html =404;
|
try_files $uri $uri/ $uri.html =404;
|
||||||
|
|||||||
Reference in New Issue
Block a user