Piattaforma ITI TECHNOLOGY: monorepo, Medusa, API, sito, area riservata e deploy
Deploy stack su Proxmox / deploy (push) Failing after 3s
Deploy stack su Proxmox / deploy (push) Failing after 3s
Monorepo npm con apps/public (Angular SSR), apps/private (Angular SPA), apps/api (Fastify), packages/shared e packages/styles; Medusa 2.21 in medusa/; infrastruttura Docker (Postgres PostGIS+pgvector, Redis, Caddy, backup) e workflow Gitea Actions per il deploy via SSH a ogni push su master. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018jQyT6dR9czzGwqb7FkG6u
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
import type { FastifyPluginAsyncZod } from "fastify-type-provider-zod"
|
||||
import { z } from "zod"
|
||||
|
||||
const healthResponse = z.object({
|
||||
status: z.literal("ok"),
|
||||
uptime: z.number(),
|
||||
timestamp: z.iso.datetime(),
|
||||
})
|
||||
|
||||
/** GET /health — liveness per Docker/Caddy. Escluso dal rate limit. */
|
||||
const healthRoutes: FastifyPluginAsyncZod = async (app) => {
|
||||
app.get(
|
||||
"/health",
|
||||
{
|
||||
config: { rateLimit: false },
|
||||
// Healthcheck Docker ogni 15 s: niente righe "incoming request"/"request completed" nei log (errori sì)
|
||||
logLevel: "warn",
|
||||
schema: { response: { 200: healthResponse } },
|
||||
},
|
||||
async () => ({
|
||||
status: "ok" as const,
|
||||
uptime: Math.round(process.uptime()),
|
||||
timestamp: new Date().toISOString(),
|
||||
}),
|
||||
)
|
||||
}
|
||||
|
||||
export default healthRoutes
|
||||
Reference in New Issue
Block a user