Skip to main content
Deno 2 is finally here πŸŽ‰οΈ
Learn more
Module

x/denorest/lib/server.ts>WebApp

Lightweight, Minimalist Framework For REST API πŸ¦• πŸš€
Latest
class WebApp
import { WebApp } from "https://deno.land/x/denorest@v4.2/lib/server.ts";

A class which registers router.

Properties

private
allowME: boolean
private
dHeaders: Record<string, string>
private
hand: (req: Request) => Promise<Response>

main handler

private
hand404: (_: Req, res: Res) => void

default 404 status code handler

private
hand500: (_: Req, res: Res) => void

default 500 status code handler

allowMoreExp: (allow: boolean) => unknown

set more path Exp

headers: (headers: Record<string, string>) => unknown

Set default headers

listen: (port: number) => unknown

listen server

listenTls: (
port: number,
certFile: string,
keyFile: string,
) => unknown

listen server on TLS

routes: Routes[]
set: (r: Router) => unknown

set routes

set404: (hand: (req: Req, res: Res) => void) => unknown

set 404 error handler

set500: (hand: (req: Req, res: Res) => void) => unknown

set 500 error handler