finish dis
This commit is contained in:
1
readme.md
Normal file
1
readme.md
Normal file
@@ -0,0 +1 @@
|
|||||||
|
Redirect to various sites of mine based on the hosts cname (since I own multiple domains)
|
||||||
@@ -5,7 +5,7 @@ var port = process.env.PORT || 3000;
|
|||||||
|
|
||||||
app.get('/*', function (req, res) {
|
app.get('/*', function (req, res) {
|
||||||
var host = S(req.headers.host);
|
var host = S(req.headers.host);
|
||||||
|
|
||||||
if(host.contains('github')){
|
if(host.contains('github')){
|
||||||
return res.redirect(301, 'https://github.com/tparnell8');
|
return res.redirect(301, 'https://github.com/tparnell8');
|
||||||
}
|
}
|
||||||
@@ -18,7 +18,7 @@ app.get('/*', function (req, res) {
|
|||||||
if(host.contains('resume')){
|
if(host.contains('resume')){
|
||||||
return res.redirect(301,'http://resume.tparnell.io');
|
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 () {
|
var server = app.listen(port, function () {
|
||||||
@@ -26,4 +26,4 @@ var server = app.listen(port, function () {
|
|||||||
var port = server.address().port;
|
var port = server.address().port;
|
||||||
|
|
||||||
console.log('listening at http://%s:%s', host, port);
|
console.log('listening at http://%s:%s', host, port);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user