Fix fetch URL resolution when served under a subpath
This commit is contained in:
+1
-1
@@ -15,7 +15,7 @@ spec:
|
|||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- name: m1730-generator
|
- name: m1730-generator
|
||||||
image: git.baumann.gr/adebaumann/m1730-generator:0.2
|
image: git.baumann.gr/adebaumann/m1730-generator:0.3
|
||||||
imagePullPolicy: Always
|
imagePullPolicy: Always
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 5000
|
- containerPort: 5000
|
||||||
|
|||||||
@@ -177,7 +177,8 @@
|
|||||||
const status = document.getElementById('status');
|
const status = document.getElementById('status');
|
||||||
status.textContent = 'Generating…';
|
status.textContent = 'Generating…';
|
||||||
try {
|
try {
|
||||||
const resp = await fetch('generate', {
|
const base = window.location.href.split('?')[0].replace(/\/?$/, '/');
|
||||||
|
const resp = await fetch(base + 'generate', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
body: new FormData(document.getElementById('form')),
|
body: new FormData(document.getElementById('form')),
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user