Spaces:
Sleeping
Sleeping
yassinekolsi
Fix Next.js 16 build: disable cacheComponents, add force-dynamic to all API routes and pages with server fetches
a3ea1a9 | import { NextResponse } from 'next/server'; | |
| import { getProteins } from '@/lib/api'; | |
| export const dynamic = 'force-dynamic'; | |
| export async function GET() { | |
| try { | |
| const result = await getProteins(); | |
| return NextResponse.json(result); | |
| } catch (error) { | |
| console.error('Proteins API error:', error); | |
| return NextResponse.json({ error: 'Failed to fetch proteins' }, { status: 500 }); | |
| } | |
| } | |