Skip to main content
Module

x/oak/router.ts>Router#redirect

A middleware framework for handling HTTP with Deno 🐿️ 🦕
Extremely Popular
Go to Latest
method Router.prototype.redirect
import { Router } from "https://deno.land/x/oak@v10.6.0/router.ts";

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]