Error route configuration
Caddy route for error response
// Simple 404 handler
const route = buildErrorRoute({
statusCode: 404,
message: "Page not found",
});
// JSON error response for API
const route = buildErrorRoute({
match: { path: ["/api/*"] },
statusCode: 500,
message: '{"error":"Internal server error"}',
headers: { "Content-Type": ["application/json"] },
});
Build an error route that returns a static error response