Are you an LLM? You can read better optimized documentation at /integrations/http.md for this page in Markdown format
HTTP Integration ​
The HTTP integration provides a request handler for Node.js HTTP servers.
Basic Usage ​
ts
import { } from 'node:http';
import { , } from 'medicus';
import { } from 'medicus/http';
const = new ({
: {
: () => .
}
});
const = ();
const = ((, ) => {
const = new (. ?? '', `http://${..}`);
if (. === '/health') {
return (., );
}
// Handle other routes...
});
Query Parameters ​
?debug
- Include debug information?last
- Return cached result?simulate=unhealthy|degraded|healthy
- Simulate status
Options ​
ts
interface HttpHealthCheckOptions {
?: boolean; // Include debug info by default
?: <string, string>; // Custom headers (includes cache prevention by default)
}