basic 'site page', model and controller for FindById creation
This commit is contained in:
12
controllers/sites.js
Normal file
12
controllers/sites.js
Normal 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 });
|
||||
});
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user