39b91d8c87
feat(ai): enhance AI admin client with status messages for API key configuration refactor(api): remove authorization check from products route
17 lines
532 B
TypeScript
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 });
|
|
}
|