Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

Server

import { Server } from "https://raw.githubusercontent.com/gemrest/laurali/main/mod.ts";
abstract

The base Laurali server to be extended upon

abstract class Server {
constructor(
certFile: string,
keyFile: string,
);
protected onError?(): void;
protected onListen?(): void;
protected onPostRoute?(ctx?: Deno.TlsConn): void;
protected onPreRoute?(ctx?: Deno.TlsConn): void;
addHook(hook: Hook, handler: () => void);
addRoute(route: string, handler: () => any);
async listen();
 
static get port();
static get hostname();
}

§Constructors

§
new Server(certFile: string, keyFile: string, config?: ServerConfiguration)
[src]
@param certFile

The path to the public key file of the Server

@param keyFile

The path to the private key file of the Server

@param config

Extra configuration options of the Server

§Methods

§
onError(): void protected optional
[src]

The response delivered to a client when the Server experiences any error while evaluating the result of a route function, or if the Server cannot find a route function for a given path.

§
onListen(): void protected optional
[src]

Called before the Server starts listening for connections

§
onPostRoute(ctx?: Deno.TlsConn): void protected optional
[src]

Called after a connection to a client has concluded

§
onPreRoute(ctx?: Deno.TlsConn): void protected optional
[src]

Called before a connection to a client has been responded to

§
addHook(hook: Hook, handler: () => void)
[src]

Add a hook function to the Server

§
addRoute(route: string, handler: () => any)
[src]

Add a route function to the Server

§
listen()
[src]

Start listening and responding to client connections

§Static Properties

§
port readonly
[src]

Get the port of the Server

§
hostname readonly
[src]

Get the hostname of the Server