const API_URL = process.env.API_URL ?? 'http://localhost:3001'; export async function GET(req: Request) { const { searchParams } = new URL(req.url); const url = new URL(`${API_URL}/routes`); searchParams.forEach((v, k) => url.searchParams.set(k, v)); const res = await fetch(url, { cache: 'no-store' }); return Response.json(await res.json(), { status: res.status }); } export async function POST(req: Request) { const body = await req.json(); const res = await fetch(`${API_URL}/routes`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(body), }); return Response.json(await res.json(), { status: res.status }); }