chore: misc cleanup

This commit is contained in:
Cory Dransfeldt 2024-08-12 14:01:39 -07:00
parent cab8b34832
commit 31b69ae565
No known key found for this signature in database
7 changed files with 32 additions and 17 deletions

View file

@ -20,5 +20,21 @@ async function handleRequest(request) {
headers: newHeaders
})
}
if (url.pathname === '/js/api/send') {
const targetUrl = 'https://dashboard.coryd.dev/api/send'
const response = await fetch(targetUrl, {
method: request.method,
headers: request.headers,
body: request.body
})
return new Response(response.body, {
status: response.status,
statusText: response.statusText,
headers: response.headers
})
}
return fetch(request)
}