Health Checks
healthCheck()
Section titled “healthCheck()”Add a health check endpoint for monitoring and DevOps:
app.healthCheck(); // default: GET /healthapp.healthCheck("/status"); // custom pathResponse
Section titled “Response”{ "status": "OK", "uptime": 123.456, "pid": 12345, "timestamp": "2025-01-01T00:00:00.000Z"}With Readiness Check
Section titled “With Readiness Check”app.healthCheck({ readinessCheck: async () => { const dbOk = await checkDatabase(); return { ok: dbOk }; }});Returns 503 if the readiness check fails.
Redirects
Section titled “Redirects”Simplified URL redirection:
// Single redirectapp.redirect("/old", "/new");
// With status codeapp.redirect("/legacy", "/modern", 301);
// Map syntaxapp.redirect({ "/old-page": "/new-page", "/deprecated": "/current"});
// Array syntaxapp.redirect([ ["/a", "/b"], ["/c", "/d", 301]]);