Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/hex/src/fw/service/deps.ts>oak.Router#redirect

An ecosystem delivering practices, philosophy and portability. Powered By Deno and JavaScript.
Go to Latest
method oak.Router.prototype.redirect
import { oak } from "https://deno.land/x/hex@0.6.3/src/fw/service/deps.ts";
const { Router } = oak;

Register a direction middleware, where when the source path is matched the router will redirect the request to the destination path. A status of 302 Found will be set by default.

The source and destination can be named routes.

Parameters

source: string
destination: string | URL
optional
status: RedirectStatus = [UNSUPPORTED]