mirror of
https://github.com/atlanticbiomedical/biomedjs.git
synced 2025-07-02 00:47:26 -04:00
latest changes
This commit is contained in:
25
app/controllers/site.js
Normal file
25
app/controllers/site.js
Normal file
@ -0,0 +1,25 @@
|
||||
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()
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user