import { endpoint } from "https://deno.land/x/cav@0.2.3/endpoint.ts";
Constructs a new Endpoint request handler. The schema properties will be assigned to the returned endpoint function, so that they can be reused on other endpoint schemas.
Type Parameters
optional
Schema extends EndpointSchema = { }Parameters
optional
schema: EndpointSchema & Schema | nulloptional
resolve: (x: ResolveArg<(Schema["param"] extends Parser ? ParserOutput<Schema["param"]> : ParamRecord), (Schema["ctx"] extends (x: CtxArg) => infer C ? C : undefined), (Schema["query"] extends Parser ? ParserOutput<Schema["query"]> : QueryRecord), (Schema["body"] extends Parser ? ParserOutput<Schema["body"]> : undefined)>) => Promise<Result> | Result