Harden production deployment workflow
This commit is contained in:
@@ -164,7 +164,7 @@ async function getContactUsPageData(locale: Locale) {
|
||||
return payload.findGlobal({
|
||||
depth: 1,
|
||||
locale,
|
||||
slug: 'contactUsPage' as any,
|
||||
slug: 'contactUsPage',
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -341,7 +341,7 @@ async function getDownloadsPageSettings(locale: Locale): Promise<DownloadsPageSe
|
||||
return (await payload.findGlobal({
|
||||
depth: 1,
|
||||
locale,
|
||||
slug: 'downloadsPage' as any,
|
||||
slug: 'downloadsPage',
|
||||
})) as DownloadsPageSettings
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import type { Metadata } from 'next'
|
||||
import { NextIntlClientProvider } from 'next-intl'
|
||||
import { getMessages, setRequestLocale } from 'next-intl/server'
|
||||
import { notFound } from 'next/navigation'
|
||||
import { isLocale, locales } from '@/i18n/config'
|
||||
import { isLocale } from '@/i18n/config'
|
||||
import { CookieConsent } from '@/components/site/cookie-consent'
|
||||
import { ScrollToTop } from '@/components/site/scroll-to-top'
|
||||
import { SiteHeader } from '@/components/site/site-header'
|
||||
|
||||
@@ -15,7 +15,7 @@ import { ProductContentTabs } from './product-content-tabs'
|
||||
import { ProductGallerySection } from './product-gallery-section'
|
||||
import { ProductTemplateMount } from './product-template-mount'
|
||||
import { ProductVideosSection } from './product-videos-section'
|
||||
import type { Media, News, NewsCategory, Product, ProductCategory, ProductReview, ProductVideo } from '@/payload-types'
|
||||
import type { Media, News, NewsCategory, Product, ProductCategory, ProductReview } from '@/payload-types'
|
||||
|
||||
export const revalidate = 300
|
||||
|
||||
|
||||
@@ -191,7 +191,7 @@ export default async function ProductsPage({
|
||||
const payload = await getPayloadClient()
|
||||
const page = await payload.findGlobal({
|
||||
depth: 1,
|
||||
slug: 'productsPage' as any,
|
||||
slug: 'productsPage',
|
||||
locale,
|
||||
})
|
||||
const categories = await payload.find({
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
import { NextResponse } from 'next/server'
|
||||
import { getPayloadClient } from '@/lib/payload'
|
||||
|
||||
export const runtime = 'nodejs'
|
||||
export const dynamic = 'force-dynamic'
|
||||
|
||||
export async function GET() {
|
||||
try {
|
||||
const payload = await getPayloadClient()
|
||||
await payload.find({
|
||||
collection: 'products',
|
||||
depth: 0,
|
||||
limit: 1,
|
||||
pagination: false,
|
||||
})
|
||||
|
||||
return NextResponse.json({
|
||||
ok: true,
|
||||
service: 'eversoloweb',
|
||||
database: 'ok',
|
||||
timestamp: new Date().toISOString(),
|
||||
})
|
||||
} catch (error) {
|
||||
return NextResponse.json(
|
||||
{
|
||||
ok: false,
|
||||
service: 'eversoloweb',
|
||||
database: 'error',
|
||||
error: error instanceof Error ? error.message : 'Unknown health check failure',
|
||||
timestamp: new Date().toISOString(),
|
||||
},
|
||||
{ status: 503 },
|
||||
)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user