Skip to main content
Module

x/oak_nest/mod.ts

Refer to nestjs to realize some common functions for Deno
Go to Latest
import * as oakNest from "https://deno.land/x/oak_nest@v1.13.15/mod.ts";

Classes

A class which registers middleware (via .use()) and then processes inbound requests against that middleware (via .listen()).

Provides context about the current request and response to middleware functions, and the current instance being processed is the first argument provided a Middleware function.

An interface which allows setting and accessing cookies related to both the current request and response. Each Context has a property .cookies which is an instance of this class.

An interface for registering middleware that will run when certain HTTP methods and paths are requested, as well as provides a way to parameterize parts of the requested path.

An interface which provides information about the current request. The instance related to the current request is available on the Context's .request property.

An interface to control what response will be sent when the middleware finishes processing the request.

Validation error description.

Enums

Standard HTTP status codes.

Variables

this is a high function which will return a param decorator.

this is a lower function which compared with createParamDecorator, it remove one player.

A symbol that indicates to response.redirect() to attempt to redirect back to the request referrer. For example:

A record of all the status codes text.

Functions

Make an assertion, error will be thrown if expr does not have truthy value.

Set background color to blue.

Set background color using 24bit rgb. color can be a number in range 0x000000 to 0xffffff or an Rgb.

Set background color using paletted 8bit colors. https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit

Set text color to blue.

Make the text bold.

Cache decorator

Calculate an ETag value for an entity. If the entity is FileInfo, then the tag will default to a weak ETag. options.weak overrides any default behavior in generating the tag.

Create an instance of an HttpError based on the status code provided.

Format date using format string

Set text color to green.

A helper function that takes the value from the If-No-Match header and an entity and returns false if the ETag for the entity matches the supplied value, otherwise false.

Inject decorator

A type guard that determines if the value is an HttpError or not.

Make the text italic.

Get params by router

Middleware that provides a back-to-back proxy for requests.

get the params from the request, if has key, then return the value which is parse by it`s type

Set text color to red.

A default metadata decorator factory that can be used on a class, class member, or parameter.

Set text color using 24bit rgb. color can be a number in range 0x000000 to 0xffffff or an Rgb.

Set text color using paletted 8bit colors. https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit

Asynchronously fulfill a response with a file from the local file system.

Decorator that assigns metadata to the class/function using the specified key.

Validates given object and reject on error.

Set text color to yellow.

Interfaces

Interface defining a Class type provider.

Interface defining a Dynamic Module.

Interface defining an Existing (aliased) type provider.

Interface defining a Factory type provider.

When reading a body in full via .read() from a FormDataReader this is what is what the value is resolved, providing a split between any fields, and multi-part files that were provided.

Options which impact how the form data is decoded for a FormDataReader. All these options have sensible defaults for most applications, but can be modified for different use cases. Many of these options can have an impact on the stability of a server, especially if there is someone attempting a denial of service attack on your server, so be careful when changing the defaults.

Middleware are functions which are chained together to deal with requests.

Interface describing implementation of an interceptor.

Interface describing options for serving static assets.

Interface defining a Value type provider.