Skip to content

Commit be7247e

Browse files
committed
Use relative API paths for subpath deployment
Removes leading slash from fetch() calls so the app works when served behind a reverse proxy at a subpath.
1 parent 89805df commit be7247e

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

internal/web/static/app.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ async function init() {
136136

137137
// Load chapters for the slider
138138
try {
139-
const chapResp = await fetch('/api/chapters');
139+
const chapResp = await fetch('api/chapters');
140140
chapters = await chapResp.json();
141141
} catch (e) {
142142
document.getElementById('chapter-label').textContent = 'Error loading chapters';
@@ -306,10 +306,10 @@ async function loadData() {
306306

307307
try {
308308
const [locResp, relResp, coordResp, contResp] = await Promise.all([
309-
fetch('/api/locations?through=' + through),
310-
fetch('/api/relationships?through=' + through),
311-
fetch('/api/coordinates'),
312-
fetch('/api/containment')
309+
fetch('api/locations?through=' + through),
310+
fetch('api/relationships?through=' + through),
311+
fetch('api/coordinates'),
312+
fetch('api/containment')
313313
]);
314314

315315
locations = await locResp.json();

0 commit comments

Comments
 (0)