Fix fetch URL resolution when served under a subpath

This commit is contained in:
2026-07-12 01:21:55 +02:00
parent b4dc8d6e65
commit ebba1ade5e
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -177,7 +177,8 @@
const status = document.getElementById('status');
status.textContent = 'Generating…';
try {
const resp = await fetch('generate', {
const base = window.location.href.split('?')[0].replace(/\/?$/, '/');
const resp = await fetch(base + 'generate', {
method: 'POST',
body: new FormData(document.getElementById('form')),
});