Skip to content

Commit 29d7c71

Browse files
committed
Redirect old URL to new URL
1 parent 7bf710a commit 29d7c71

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

app/index.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,18 @@ const express = require('express');
44
const app = express();
55

66
const {
7-
apiEndpoint
7+
apiEndpoint,
88
} = require('../environment');
99

1010
const frontend = require('./frontend');
1111
const backend = require('./backend');
12+
app.use((req, res, next) => {
13+
if (req.hostname === 'algo-visualizer.jasonpark.me') return res.redirect(301, 'http://algorithm-visualizer.org/');
14+
next();
15+
});
1216
app.use(apiEndpoint, backend);
1317
app.use(history());
1418
app.use(compression());
1519
app.use(frontend);
1620

17-
module.exports = app;
21+
module.exports = app;

0 commit comments

Comments
 (0)