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.0-alpha.7/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

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

Parameters

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