basic 'site page', model and controller for FindById creation

This commit is contained in:
2020-01-04 18:02:15 -05:00
parent 191e7e825a
commit ff98c8c4fa
9 changed files with 61 additions and 16 deletions

12
controllers/sites.js Normal file
View File

@ -0,0 +1,12 @@
var Site = require('../model/Site');
module.exports = {
// Find site by ID export
findById: function(req, res){
Site.findById(req.params.id, function(err, site){
if(err) throw err;
console.log("Site->Controller: findById queried: " + site.site);
res.render('site', { title: site.site, site: site });
});
}
}