production: docker fixes, nginx SSL config, generateStaticParams fallback
Deploy to VPS / deploy (push) Has been cancelled
Deploy to VPS / deploy (push) Has been cancelled
This commit is contained in:
@@ -30,8 +30,20 @@ function getApplicationImages(slug: string) {
|
||||
|
||||
// GENERACIÓN DE RUTAS ESTÁTICAS DESDE LA BD
|
||||
export async function generateStaticParams() {
|
||||
const apps = await prisma.application.findMany({ select: { slug: true } });
|
||||
return apps.map((app: { slug: string }) => ({ slug: app.slug }));
|
||||
// In production Docker build, DB is not available.
|
||||
// Pages are generated on-demand via SSR instead.
|
||||
if (process.env.NODE_ENV === 'production' && !process.env.VERCEL) {
|
||||
return [];
|
||||
}
|
||||
|
||||
try {
|
||||
const apps = await prisma.application.findMany({
|
||||
select: { slug: true },
|
||||
});
|
||||
return apps.map((app: any) => ({ slug: app.slug }));
|
||||
} catch {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
export const revalidate = 60;
|
||||
@@ -76,4 +88,4 @@ export default async function ApplicationPage({ params }: { params: Promise<{ sl
|
||||
|
||||
// Pasamos TODO al componente cliente interactivo (que ya viene traducido)
|
||||
return <ApplicationClient data={data} realCases={realCases} images={images} />;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user