Fix fetch URL resolution when served under a subpath
This commit is contained in:
@@ -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')),
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user