mirror of
https://github.com/jimeh/heartb.it.git
synced 2026-02-19 12:56:47 +00:00
17 lines
350 B
JavaScript
17 lines
350 B
JavaScript
(function() {
|
|
|
|
module.exports = function(redirect_map) {
|
|
if (redirect_map == null) redirect_map = {};
|
|
return function(req, res, next) {
|
|
var host;
|
|
host = req.header('Host');
|
|
if (redirect_map[host]) {
|
|
return res.redirect(redirect_map[host]);
|
|
} else {
|
|
return next();
|
|
}
|
|
};
|
|
};
|
|
|
|
}).call(this);
|