Skip to content

Commit

Permalink
🌐 Forward Heroku to GitHubJobs.io #46 - Attempt another redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
alexlee-dev committed Aug 6, 2020
1 parent 404ce3a commit 0c993df
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/server/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,15 @@ class App {
this.app.use(express.static(path.join(__dirname, "../dist")));

this.app.get("*", (req: Request, res: Response) => {
console.log({ hostname: req.hostname });
console.log({ referrer: req.headers.referer });
// return res.status(301).redirect("https://www.githubjobs.io/");
if (req.headers.host === "gh-jobs.herokuapp.com") {
return res.status(301).redirect("https://www.githubjobs.io/");
}
console.log(
chalk.blueBright.inverse({
host: req.headers.host,
referrer: req.headers.referer,
})
);
res.sendFile(path.join(__dirname, "../dist/index.html"));
});
}
Expand Down

0 comments on commit 0c993df

Please sign in to comment.