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

x/netzo/plugins/auth/utils/http.ts>redirect

Full-stack Deno framework for building business web apps like internal tools, dashboards, admin panels and automated workflows.
Go to Latest
function redirect
import { redirect } from "https://deno.land/x/netzo@0.4.49/plugins/auth/utils/http.ts";

Returns a response that redirects the client to the given location (URL).

Examples

Example 1

import { redirect } from "../../../../auth/utils/http.ts";

redirect("/new-page"); // Redirects client to `/new-page` with HTTP status 303
redirect("/new-page", 301); // Redirects client to `/new-page` with HTTP status 301

Parameters

location: string

A relative (to the request URL) or absolute URL.

optional
status: Status.Created | RedirectStatus = [UNSUPPORTED]

HTTP status