Skip to main content
Module

x/oak/response.ts>REDIRECT_BACK

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

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