Skip to main content
Module

x/texa/mod.ts>Application

A Deno web framework inspired by Oak and Express. Built-in support for WebSockets, middleware and routing.
Latest
class Application
extends RouteMiddleware
Re-export
import { Application } from "https://deno.land/x/texa@0.8.1/mod.ts";

The application object.

Constructors

new
Application(addr: string, options?: { certFile?: string; keyFile?: string; allowWebSocket?: boolean; })

Initiate a new server.

Properties

private
readonly
_server: DenoServer

The Deno server.

readonly
addr: { readonly hostname: string; readonly port: number; }

The address that the server is hosted on.

readonly
onconnection: Event<[WebSocket]>

Fired when a new websocket connection is made.

readonly
onrequesterror: Event<[Pair["request"], Pair["response"], Error]>

Fired when an error occurs within the request itself or in any of the middlewares.

readonly
onwebsocketerror: Event<[Error]>

Fired when the application fails to accept a websocket.

readonly
origin: string
readonly
secure: boolean

Whether or not the server is secure.

readonly
sockets: ReadonlyMap<string, WebSocket>

The websockets that are connected to the application.

Methods

start(): Promise<void>

Start accepting incoming connections.