Skip to main content
Module

x/cav/rpc.ts>Rpc

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

An http.Handler constructed by an RpcFactory. Rpcs are one of two fundamental building blocks of Cav server applications, the other being Stacks. Rpcs are responsible for handling a request, and Stacks are responsible for routing a request to the appropriate Rpc. Once a Request reaches an Rpc and the Rpc's path matches the request, the Rpc is expected to handle all errors and return a Response. If the path doesn't match the Rpc's path, the special NO_MATCH error will be thrown. Uncaught errors bubble up to and are handled by the top-level Server, which will log them and respond with a 500 Response.

Type Parameters

optional
Resp = unknown
optional
Groups extends GroupsParser | null = null
optional
Context extends Ctx<unknown> | null = null
optional
Query extends QueryParser | null = null
optional
Message extends Parser | null = null
optional
Upgrade extends boolean | null = null

Call Signatures

(req: Request, conn: http.ConnInfo): Promise<Response>

Properties

The RpcInit options used to construct this Rpc.