Harden production deployment workflow

This commit is contained in:
Codex
2026-04-28 01:09:17 +08:00
parent c8ccaa9925
commit 46a72f815e
23 changed files with 243 additions and 21 deletions
+35
View File
@@ -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 },
)
}
}