Skip to main content
Module

x/drash/mod.ts>Server

A microframework for Deno's HTTP server with zero third-party dependencies
Go to Latest
class Server
Re-export
import { Server } from "https://deno.land/x/drash@v2.7.0/mod.ts";

This class handles the entire request-resource-response lifecycle. It is in charge of handling incoming requests, matching them to resources for further processing, and sending responses based on the processes set in the resource. It is also in charge of sending error responses that "bubble up" during the request-resource-response lifecycle.

Constructors

new
Server(options: Drash.Interfaces.IServerOptions)

Properties

readonly
address: string

Get the full address that this server is running on.

Methods

addResource(resourceClass: Drash.Resource): void

Add the given resource to this server's list of resources.

close(): Promise<void>

Close the server.

run()

Run the server.