Skip to main content
Module

x/cav/mod.ts>Ctx

A server framework for Deno
Go to Latest
interface Ctx
import { type Ctx } from "https://deno.land/x/cav@0.0.21/mod.ts";

In Cav, there is no middleware. To fill the gap, Rpcs can leverage Ctx functions to create context-dependent data related to a request. These functions are where you'd set up databases, create session objects, etc. The value returned from this function is available as the ctx property for an Rpc's resolve and resolveError functions.

Type Parameters

optional
Val = unknown

Call Signatures

(x: CtxArg): Promise<Val> | Val