diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..d894a90 --- /dev/null +++ b/readme.md @@ -0,0 +1 @@ +Redirect to various sites of mine based on the hosts cname (since I own multiple domains) diff --git a/server.js b/server.js index f0dafb0..44e6197 100644 --- a/server.js +++ b/server.js @@ -5,7 +5,7 @@ var port = process.env.PORT || 3000; app.get('/*', function (req, res) { var host = S(req.headers.host); - + if(host.contains('github')){ return res.redirect(301, 'https://github.com/tparnell8'); } @@ -18,7 +18,7 @@ app.get('/*', function (req, res) { if(host.contains('resume')){ return res.redirect(301,'http://resume.tparnell.io'); } - res.end("Error no redirects found"); + res.status(500).end("Error no redirects found"); }); var server = app.listen(port, function () { @@ -26,4 +26,4 @@ var server = app.listen(port, function () { var port = server.address().port; console.log('listening at http://%s:%s', host, port); -}); \ No newline at end of file +});