Module

x/opine/src/response.ts>Response#redirect

Fast, minimalist web framework for Deno ported from ExpressJS.
Very Popular
Go to Latest
method Response.prototype.redirect
import { Response } from "https://dotland.deno.dev/x/opine@2.2.0/src/response.ts";

Redirect to the given url with optional response status defaulting to 302.

The resulting url is determined by res.location().

Examples:

res.redirect('/foo/bar'); res.redirect('http://example.com'); res.redirect(301, 'http://example.com'); res.redirect('../login'); // /blog/post/1 -> /blog/login

Parameters

url: string

Parameters

statusCode: Status
url: string