[PIE-28] Switch to type-safe API #12

Merged
breadone merged 9 commits from PIE-28-2 into main 2025-08-16 13:17:10 +12:00
Showing only changes of commit b3f92210fa - Show all commits

View File

@ -5,8 +5,7 @@ import type { APIRoute } from "astro";
const getProxyUrl = (request: Request) => { const getProxyUrl = (request: Request) => {
const proxyUrl = new URL(import.meta.env.PUBLIC_PB_URL); const proxyUrl = new URL(import.meta.env.PUBLIC_PB_URL);
const requestUrl = new URL(request.url); const requestUrl = new URL(request.url);
return new URL(requestUrl.pathname + requestUrl.search, proxyUrl);
return new URL(requestUrl.pathname, proxyUrl);
}; };
export const ALL: APIRoute = async ({ request }) => { export const ALL: APIRoute = async ({ request }) => {