feat: add Next.js proxy routes for accounts list and QR endpoints
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
const API_URL = process.env.API_URL ?? 'http://localhost:3001';
|
||||
|
||||
export async function GET(_req: Request, { params }: { params: Promise<{ id: string }> }) {
|
||||
const { id } = await params;
|
||||
const res = await fetch(`${API_URL}/accounts/${id}/qr`, { cache: 'no-store' });
|
||||
return Response.json(await res.json(), { status: res.status });
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
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 });
|
||||
}
|
||||
Reference in New Issue
Block a user