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} />;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,8 +10,20 @@ import BreathingField from "@/components/visuals/BreathingField";
|
||||
import { getLocalizedData } from "@/lib/i18nHelper";
|
||||
|
||||
export async function generateStaticParams() {
|
||||
const articles = await prisma.newsArticle.findMany({ select: { slug: true } });
|
||||
return articles.map((a: any) => ({ slug: a.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 articles = await prisma.newsArticle.findMany({
|
||||
select: { slug: true },
|
||||
});
|
||||
return articles.map((a: any) => ({ slug: a.slug }));
|
||||
} catch {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
// ── SÚPER PARSER MARKDOWN (Con Tablas, Imágenes y Dark/Light Mode) ──
|
||||
@@ -271,4 +283,4 @@ export default async function ArticlePage({ params }: { params: Promise<{ slug:
|
||||
</div>
|
||||
</main>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user