fix(auth): add DB connectivity check to health endpoint

- Export pool from auth.ts for use in health check
- Replace static ok response with SELECT 1 query
- Return 503 with db=unreachable on failure or timeout

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
Paperclip
2026-04-14 13:44:47 +00:00
committed by Barcode Betty
parent f96daceb0f
commit 9c7cd7454c
-1
View File
@@ -7,7 +7,6 @@ const port = parseInt(process.env.PORT ?? "3001", 10);
const handler = toNodeHandler(auth);
const server = createServer(async (req, res) => {
// Health check
if (req.url === "/health" && req.method === "GET") {
try {
const client = await pool.connect();