Comments, appointments adjustments, fixed some issues

This commit is contained in:
augmentedpotato
2026-04-20 19:19:30 -06:00
parent 1523aef51e
commit 6d593726a5
34 changed files with 402 additions and 104 deletions

View File

@@ -1,5 +1,7 @@
//Backend URL, falls back to localhost for local development
const BACKEND = process.env.BACKEND_URL || 'http://localhost:8080'
//Forwards all incoming requests to the backend, preserving method, headers, and body
async function proxy(request, { params }) {
const path = (await params).path.join('/')
const { search } = new URL(request.url)
@@ -10,6 +12,8 @@ async function proxy(request, { params }) {
headers.delete('origin')
const init = { method: request.method, headers }
//Only attach a body for requests that can have one
if (!['GET', 'HEAD'].includes(request.method)) {
init.body = request.body
init.duplex = 'half'