Fix proxy and split server into modules #1

Merged
probablycorey merged 18 commits from probablycorey/fix-proxy-404s into main 2026-03-11 16:35:00 +00:00
Showing only changes of commit 6774b456a9 - Show all commits

View File

@ -29,10 +29,12 @@ function proxyFetch(req: Request): Promise<Response> | Response {
.catch(() => new Response('unhealthy', { status: 503 }))
}
const hasBody = req.method !== 'GET' && req.method !== 'HEAD'
return fetch(`http://localhost${url.pathname}${url.search}`, {
method: req.method,
headers: req.headers,
body: req.body,
body: hasBody ? req.body : undefined,
unix: SOCKET_PATH,
}).catch((e) => {
console.error('Proxy error:', e)