2026-02-24 21:47:18 +00:00

14 lines
473 B
TypeScript

export async function GET(req: Request) {
const baseUrl = process.env.LEDGERONE_API_URL ?? "http://localhost:3051"
const url = new URL(req.url);
const query = url.searchParams.toString();
const res = await fetch(`${baseUrl}/api/accounts${query ? `?${query}` : ""}`);
const payload = await res.text();
return new Response(payload, {
status: res.status,
headers: {
"Content-Type": res.headers.get("content-type") ?? "application/json"
}
});
}