Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/hex/src/fw/service/deps.ts>oak.REDIRECT_BACK

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

A symbol that indicates to response.redirect() to attempt to redirect back to the request referrer. For example:

import { Application, REDIRECT_BACK } from "https://deno.land/x/oak/mod.ts";

const app = new Application();

app.use((ctx) => {
  if (ctx.request.url.pathName === "/back") {
    ctx.response.redirect(REDIRECT_BACK, "/");
  }
});

await app.listen({ port: 80 });

type

symbol