From 759b49159e48e722f2a9dd02708debcbe08f71db Mon Sep 17 00:00:00 2001 From: maaz519 Date: Fri, 29 May 2026 11:37:48 +0530 Subject: [PATCH] feat: add Next.js proxy routes for accounts list and QR endpoints --- apps/web/app/api/accounts/[id]/qr/route.ts | 7 +++++++ apps/web/app/api/accounts/route.ts | 6 ++++++ 2 files changed, 13 insertions(+) create mode 100644 apps/web/app/api/accounts/[id]/qr/route.ts create mode 100644 apps/web/app/api/accounts/route.ts diff --git a/apps/web/app/api/accounts/[id]/qr/route.ts b/apps/web/app/api/accounts/[id]/qr/route.ts new file mode 100644 index 0000000..6dabbf5 --- /dev/null +++ b/apps/web/app/api/accounts/[id]/qr/route.ts @@ -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 }); +} diff --git a/apps/web/app/api/accounts/route.ts b/apps/web/app/api/accounts/route.ts new file mode 100644 index 0000000..fc71ed7 --- /dev/null +++ b/apps/web/app/api/accounts/route.ts @@ -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 }); +}