Skip to main content
Module

x/cav/endpoint.ts>endpoint

A server framework for Deno
Go to Latest
function endpoint
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 = { }
optional
Result = undefined

Parameters

optional
schema: EndpointSchema & Schema | null
optional
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