Skip to main content
Module

x/cav/mod.ts>socket

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

Constructs a new Socket request handler using the provided schema and setup function. The schema properties will be assigned to the returned socket endpoint function, with the setup argument available as the "setup" property.

Type Parameters

Param extends SocketSchema["param"]
Ctx extends SocketSchema["ctx"]
Query extends SocketSchema["query"]
Send extends SocketSchema["send"]
Recv extends SocketSchema["recv"]
optional
Schema extends SocketSchema = { }

Parameters

schema: Schema & { param?: Param; ctx?: Ctx; query?: Query; send?: Send; recv?: Recv; } | null
setup: (((x: SetupArg<Param, Ctx, Query, Send, Recv>) => Promise<void> | void) | null)