-
-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathlocation.ts
More file actions
33 lines (30 loc) · 825 Bytes
/
location.ts
File metadata and controls
33 lines (30 loc) · 825 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import express from "express";
import { location } from "somelibrary";
const app = express();
app.get("/", function (req, res) {
res.location(req.get("Referrer") || "/");
});
app.get("/", (req, res) => {
res.location(req.get("Referrer") || "/");
});
app.get("/", (req, res) => {
res.location("testing");
});
app.get("/", (req, res) => {
res.location();
});
app.get("/articles", function (request, response) {
response.location(request.get("Referrer") || "/");
});
app.get("/articles", function (request, response) {
response.location("testing");
});
app.get("/articles", (request, response) => {
response.location(request.get("Referrer") || "/");
});
app.get("/articles", function (_req, _res) {
location("back");
});
export function handleLocation(req, res) {
res.location(req.get("Referrer") || "/");
}