import * as knight from "https://deno.land/x/knight@2.3.0/mod.ts";
Classes
A console sink that writes to the terminal using a set of colors. Formatting is fully configurable but defaults to human readable text. | |
An interface which provides information about the current request. The
instance related to the current request is available on the
| |
An interface to control what response will be sent when the middleware finishes processing the request. | |
Sink is a class that can be attached to a | |
Default console logging formatter. |
Enums
The logging levels of a log message. |
Variables
The current timestamp in the international ISO standard for specifying dates. | |
Functions
Send an HTTP response with a status code of 202 (Accepted). | |
Send an HTTP response with a status code of 502 (Bad Gateway). | |
Send an HTTP response with a status code of 400 (Bad Request). | |
Extracts the body of a request as JSON and maps it to the given class. | |
======================================================================== Request helpers ========================================================================* | |
Send an HTTP response with a status code of 201 (Created) and the given body. Preferably return the created resource URI. | |
Redirect the client to the given temporary location URL with a status code of 302 (Found). The request method is changed to GET for the next request. | |
I'm a teapot. | |
Send an HTTP response with a status code of 500 (Internal Server Error). | |
Send an HTTP response with a status code of 204 (No Content). | |
Send an HTTP response with a status code of 406 (Not Acceptable). | |
Send an HTTP response with a status code of 404 (Not Found). | |
Send an HTTP response with a status code of 501 (Not Implemented). | |
f ok | Send an HTTP response with a status code of 200 (OK) and the given body. |
Redirect the client to the given permanent location URL with a status code of 301 (Moved Permanently). This and all future requests should be directed to the given URI. (Cached in the browser) | |
The resource requested has been definitively moved to the location URL. A browser redirects to this page and search engines update their links to the resource. | |
Redirect the client to the given temporary location URL with a status code of 307 (Temporary Redirect). The request method is not allowed to be changed when reissuing the original request. | |
Send an HTTP response with a status code of 503 (Service Unavailable). | |
Send an HTTP response with a status code of 401 (Unauthorized). |
Type Aliases
Knights own router context type.
This is a custom type that extends the Oak | |
Knights own router endpoint parameter type.
This is a custom type that extends the Oak |