fully host /kiri from /boot
This commit is contained in:
parent
1c6a988d27
commit
e183be3bd7
1 changed files with 8 additions and 0 deletions
|
|
@ -94,6 +94,14 @@ async function fetch_safe(req) {
|
|||
// --- fetch handler ---
|
||||
self.addEventListener('fetch', e => {
|
||||
const { request } = e;
|
||||
|
||||
if (request.url.endsWith("/kiri") || request.url.endsWith("/kiri/")) {
|
||||
e.respondWith((async () => {
|
||||
return Response.redirect("/kiri/index.html", 302);
|
||||
})());
|
||||
return;
|
||||
}
|
||||
|
||||
const url = new URL(request.url);
|
||||
|
||||
if (request.method !== 'GET') return;
|
||||
|
|
|
|||
Loading…
Reference in a new issue