Initial commit

This commit is contained in:
2026-02-07 11:03:53 -03:00
commit 84168f6f3c
64 changed files with 11402 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
const QR_API_URL = process.env.QR_API_URL || 'http://qr_api:8080';
export async function GET() {
try {
const res = await fetch(`${QR_API_URL}/folders`, { cache: 'no-store' });
const data = await res.json();
if (!res.ok) {
return Response.json({ error: data?.error ?? 'Failed' }, { status: res.status });
}
return Response.json(Array.isArray(data) ? data : data);
} catch (e) {
return Response.json({ error: String(e) }, { status: 502 });
}
}
export async function POST(request: Request) {
try {
const body = await request.json();
const res = await fetch(`${QR_API_URL}/folders`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(body),
});
const data = await res.json();
if (!res.ok) {
return Response.json({ error: data?.error ?? 'Failed' }, { status: res.status });
}
return Response.json(data);
} catch (e) {
return Response.json({ error: String(e) }, { status: 502 });
}
}