/opt/canhelp/apps/api/src/routes
NameSizeModeActions
admin.ts950570644editdlrm
auto-match.ts74060644editdlrm
auto-response.ts81110644editdlrm
availability.ts72940644editdlrm
categories.ts18670644editdlrm
chat.ts93770644editdlrm
dashboard.ts51420644editdlrm
favorites.ts44410644editdlrm
fomo.ts68440644editdlrm
google.ts48720644editdlrm
health.ts12140644editdlrm
i18n.ts1670860644editdlrm
locations.ts17810644editdlrm
notifications.ts28620644editdlrm
offers.ts100470644editdlrm
payments.ts211670644editdlrm
plans.ts13520644editdlrm
portfolio.ts66580644editdlrm
price-list.ts144170644editdlrm
reports.ts20070644editdlrm
reviews.ts27830644editdlrm
skill-suggestions.ts10350644editdlrm
specialist-cards.ts186410644editdlrm
stats.ts10930644editdlrm
statuses.ts37310644editdlrm
support.ts84520644editdlrm
tasks.ts300180644editdlrm
uploads.ts15260644editdlrm
users.ts371570644editdlrm
Edit: /opt/canhelp/apps/api/src/routes/health.ts (1214B)
import { Hono } from 'hono' import { db } from '../db.js' import { redis } from '../redis.js' import { sql } from 'drizzle-orm' import { getAppleClientSecretExpDebugInfo } from '../lib/apple-client-secret.js' const app = new Hono() const healthDebugToken = process.env.HEALTH_DEBUG_TOKEN?.trim() app.get('/', async (c) => { let dbOk = false let redisOk = false try { await db.execute(sql`SELECT 1`) dbOk = true } catch {} try { await redis.ping() redisOk = true } catch {} const status = dbOk && redisOk ? 200 : 503 return c.json({ status: status === 200 ? 'ok' : 'degraded', db: dbOk, redis: redisOk }, status) }) app.get('/debug', async (c) => { // Secure-by-default: endpoint stays unavailable until token is configured. if (!healthDebugToken) { return c.json({ error: 'Not found' }, 404) } const token = c.req.header('X-Debug-Token')?.trim() if (!token || token !== healthDebugToken) { return c.json({ error: 'Unauthorized' }, 401) } const appleJwt = getAppleClientSecretExpDebugInfo() console.log('[Health Debug] Apple JWT exp:', appleJwt.expIso ?? 'n/a', 'configured:', appleJwt.configured) return c.json({ appleJwt }) }) export default app