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.0.23/mod.ts";

Constructs a new Endpoint handler using the provided schema. The schema properties are also available on the returned Endpoint function.

Type Parameters

Schema
optional
GroupsOutput = Record<string, string | string[]>
optional
Ctx = undefined
optional
QueryInput extends Record<string, string | string[]> = (Record<string, string | string[]>)
optional
QueryOutput = Record<string, string | string[]>
optional
MessageInput = unknown
optional
MessageOutput = undefined
optional
Resp = undefined

Returns

Endpoint<[K in keyof Schema | "resolve"]: (K extends "resolve" ? Exclude<resolve, undefined> : K extends keyof Schema ? Schema[K] : never)>