comprehensive monitoring and logging system

This commit is contained in:
2025-08-19 14:56:42 +02:00
parent 558172f2be
commit 52bde64e7f
2 changed files with 116 additions and 0 deletions

17
pages/api/health.ts Normal file
View File

@@ -0,0 +1,17 @@
import type { NextApiRequest, NextApiResponse } from "next"
import { getHealthStatus } from "../../lib/monitoring"
export default async function handler(req: NextApiRequest, res: NextApiResponse) {
if (req.method !== "GET") return res.status(405).json({ error: "Method not allowed" })
try {
const health = getHealthStatus()
res.status(200).json(health)
} catch (error) {
res.status(500).json({
status: 'unhealthy',
error: 'Health check failed',
timestamp: new Date().toISOString()
})
}
}