Skip to main content
class GemApplication
import { GemApplication } from "https://deno.land/x/gem@v0.0.2/application.ts";

Constructors

new
GemApplication()

Properties

private
closed: boolean
private
middleware: GemMiddleware[]
private
socket: Deno.Listener | undefined

Methods

handle(url: string): Promise<GemResponse>

Handles a request/URL by running the middleware. It returns the response

listen(addr: string): Promise<void>

Start listening for requests, processing registered middleware on each request. If the options .secure is undefined or false, the listening will be over raw TCP. If the options .secure property is true, a .certFile and a .keyFile property need to be supplied and requests will be processed over TLS.

listen(options: ListenOptions): Promise<void>

Start listening for requests, processing registered middleware on each request. If the options .secure is undefined or false, the listening will be over raw TCP. If the options .secure property is true, a .certFile and a .keyFile property need to be supplied and requests will be processed over TLS.