UNPKG

487 BPlain TextView Raw
1import Response from "./response";
2import { Request as ERequest, Response as EResponse } from "express";
3
4/**
5 * Generation of a redirect response.
6 */
7export default class RedirectResponse extends Response {
8 private path: string;
9
10 /**
11 * Base constructor
12 * @param path the redirect path
13 */
14 constructor(path: string) {
15 super();
16 this.path = path;
17 }
18
19 performResponse(_: ERequest, res: EResponse) {
20 res.redirect(this.path);
21 }
22}