Files
tower/apps/web/app/api/accounts/route.ts
T
2026-05-29 11:49:23 +05:30

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 });
}