Files
recipe-app/frontend/app/api/products/route.ts
T
Nils-Johan Gynther 39b91d8c87 feat(products): add public access to findAll and findAllTags endpoints
feat(ai): enhance AI admin client with status messages for API key configuration
refactor(api): remove authorization check from products route
2026-04-19 11:42:10 +02:00

17 lines
532 B
TypeScript

import { NextRequest, NextResponse } from 'next/server';
const API_BASE = process.env.NEXT_PUBLIC_API_URL_INTERNAL || 'http://recipe-api:8080';
export const dynamic = 'force-dynamic';
export async function GET(req: NextRequest) {
const url = new URL(req.url);
const query = url.searchParams.toString();
const res = await fetch(`${API_BASE}/api/products${query ? `?${query}` : ''}`, {
cache: 'no-store',
});
const data = await res.json();
return NextResponse.json(data, { status: res.status });
}