mirror of
https://github.com/atlanticbiomedical/biomedjs.git
synced 2025-07-02 00:47:26 -04:00
26 lines
465 B
JavaScript
26 lines
465 B
JavaScript
var mongoose = require('mongoose'),
|
|
Post = mongoose.model('Post');
|
|
|
|
module.exports = function(piler) {
|
|
return {
|
|
index: function(req, res, next) {
|
|
host = String(req.headers['x-forwarded-host']);
|
|
host = host.split(':')[0];
|
|
|
|
if (host != 'site.atlb.co') {
|
|
return next();
|
|
}
|
|
|
|
if (!req.user) {
|
|
req.session.redirectUrl = req.url
|
|
}
|
|
|
|
var path = req.path.slice(1);
|
|
|
|
res.render('site.jade', {
|
|
css: piler.css.renderTags()
|
|
});
|
|
}
|
|
}
|
|
}
|