Skip to main content
Module

x/abc/context.ts>Context

A better Deno framework to create web application.
Go to Latest
class Context
import { Context } from "https://deno.land/x/abc@v0.1.6/context.ts";

Constructors

new
Context(options: ContextOptions)

Properties

private
_abc: Abc
private
_params: Record<string, string>
private
_request: ServerRequest
private
_response: Response
private
_url: URL
abc: Abc
readonly
method: string
params
readonly
path: string
readonly
queryParams: Record<string, string>
request: ServerRequest
response: Response
url: URL

Methods

private
writeContentType(v: string)
bind<T>(cls: Type<T>): Promise<T>
blob(
b: Uint8Array | Deno.Reader,
contentType: string,
code?,
)

Sends a blob response with content type and status code.

file(filepath: string)
html(v: string, code?)

Sends an HTTP response with status code.

htmlBlob(b: Uint8Array | Deno.Reader, code?)

Sends an HTTP blob response with status code.

json(v: Record<string, any> | string, code?)
render<T>(
name: string,
data?,
code?,
)

Renders a template with data and sends a text/html response with status code. Abc.renderer must be registered first.

string(v: string, code?)