Skip to main content
Module

x/cav/util.ts>redirect

A server framework for Deno
Go to Latest
function redirect
import { redirect } from "https://deno.land/x/cav@0.0.21/util.ts";

Utility for creating an Rpc handler that always redirects. If an origin isn't provided in the redirect url, the origin of the request will be used. Paths can also be relative; if the path starts with a ".", the path will be joined with the pathname of the request using the std path.join() function. If the status isn't provided, 302 is used. Note that paths with trailing slashes will be redirected first to the path without the trailing slash before being redirect to the specified destination. (2 hops)

Parameters

to: string
optional
status: number