Skip to content

Commit

Permalink
archive domain
Browse files Browse the repository at this point in the history
  • Loading branch information
rosano committed Feb 28, 2024
1 parent 52bf5d6 commit fbab1be
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,19 @@ app.use(function correctDomain (req, res, next) {
return res.redirect(301, 'https://' + map[req.get('host')] + req.originalUrl);
});

app.use(function archiveDomain (req, res, next) {
const map = {
'notethesound.com': 'https://rosano.ca/notethesound',
'scrutinizethis.com': 'https://go.rosano.ca/scrutinizethis',
'sonogrid.com': 'https://rosano.ca/sonogrid',
};

if (!Object.keys(map).includes(req.get('host'))) {
return next();
}

return res.redirect(301, map[req.get('host')]);
});


app.listen(process.env.PORT);

0 comments on commit fbab1be

Please sign in to comment.