Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/drash/mod.ts>Resource

A microframework for Deno's HTTP server with zero third-party dependencies
Go to Latest
class Resource
implements [[Drash.Interfaces].IResource]
import { Resource } from "https://deno.land/x/drash@v2.7.0/mod.ts";

This is the base resource class for all resources. All resource classes must extend this base resource class.

Drash defines a resource according to the MDN at the following page:

https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Identifying_resources_on_the_Web

Properties

protected
drash_resource: boolean

Internal property used to identify this as a Drash resource.

paths: string[]
services: Drash.Interfaces.IResourceServices

Methods

redirect(
location: string,
response: Drash.Response,
status?,
headers?: Drash.Types.HttpHeadersKeyValuePairs,
): void

Redirect the incoming request to another resource