2f88e883b2
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
17 lines
543 B
TypeScript
17 lines
543 B
TypeScript
const API_URL = process.env.API_URL ?? 'http://localhost:3001';
|
|
|
|
export async function GET() {
|
|
const res = await fetch(`${API_URL}/accounts`, { 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}/accounts`, {
|
|
method: 'POST',
|
|
headers: { 'Content-Type': 'application/json' },
|
|
body: JSON.stringify(body),
|
|
});
|
|
return Response.json(await res.json(), { status: res.status });
|
|
}
|