Skip to main content
Module

x/cav/mod.ts>endpoint

A server framework for Deno
Go to Latest
function endpoint
import { endpoint } from "https://deno.land/x/cav@0.2.0-alpha.4/mod.ts";

Constructs a new Endpoint request handler using the provided schema and resolver function. The schema properties will be assigned to the returned endpoint function, so that they can be reused on other endpoint schemas.

Type Parameters

Schema extends EndpointSchema
Param extends EndpointSchema["param"]
Ctx extends EndpointSchema["ctx"]
Query extends EndpointSchema["query"]
Body extends EndpointSchema["body"]
optional
Result = undefined

Parameters

schema: Schema & EndpointSchema & { param?: Param; ctx?: Ctx; query?: Query; body?: Body; resolve?: ((x: ResolveArg<Param, Ctx, Query, Body>) => Result) | null; }