slugs created and implemented

This commit is contained in:
2020-01-07 14:23:44 -05:00
parent eb9d8f78f7
commit e69a1e03f8
6 changed files with 38 additions and 4 deletions

View File

@ -13,6 +13,16 @@ module.exports = {
}
});
},
findBySlug: function(req, res){
Site.findBySlug(req.params.slug, function(err, site){
// if(err) throw err;
if(err) res.render('index', { title: 'Site is not found!'});
else {
console.log("Site->Controller: findBySlug queried: " + site.site);
res.render('site', { title: site.site, site: site });
}
});
},
getHome: function(req, res){
Site.getAll(function(err, sites){
Visit.findUniqueSites(function(err, uniqueSites){