Function defineHTTPHandler
- defineHTTPHandler(handler): RequestHandler
Parameters
handler: RequestHandler
Returns RequestHandler
See
Example
import { defineHTTPHandler } from "@rollout/framework";
export const http = defineHTTPHandler((request) => {
return Response.json(`Hello from ${request.url}!`);
});
Used to define a Connector HTTP handler. Accepts a handler fuction which takes a single Request parameter and should return a Response instance.