Skip to main content
Module

x/dropserver_app/mod.ts>Context

Library that helps you create Dropserver applications
Latest
interface Context
import { type Context } from "https://deno.land/x/dropserver_app@v0.2.1/mod.ts";

Context is passed to app's request handlers.

Properties

request: Request

request is the raw request. Note that the url is incorrect (?)

params: Record<string, unknown>

params are values of parametrized url paths for this request

url: URL

url that was actually requested (?)

proxyId: string | null

proxyId of the authenticated user who made the request, if any.

Methods

respondWith(r: Response | Promise<Response>): Promise<void>

respondWith sends a response to the request

respondHtml(html: string): void

respondHtml sends the html string with HTML content headers

respondJson(data: any): void

respondJson sends the data as JSON

respondStatus(status: number, text: string): void

respondStatus sends the status number and optional text as a response