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

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.

Examples

Example 1

import { GemApplication } from 'https://deno.land/x/gem/mod.ts';

const app = new GemApplication();

app.listen(':1965')

Parameters

addr: string

the address of the server

Returns

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.

Examples

Example 1

import { GemApplication } from 'https://deno.land/x/gem/mod.ts';

const app = new GemApplication();

app.listen({
   port: 1965,
   secure: false,
})

Parameters

options: ListenOptions

the options to use to listen

Returns

Promise<void>