Hi all, not sure if this is the right subreddit for this but I'm having troubles loading db entries in my handlebars template. Heres my code:Route file (index.js):// get blog listrouter.get('/', (req, res) => {Blogpost.findAll().then(blogposts => {res.render('index', {blogposts});}).catch(err => console.log(\Error: ${err}`));});`View file (index.handlebars):
Whenever I load the index page I only get the "No blog posts" from the else section of the handlebars file. There are definitely blogposts in the database so I'm not sure whats going on. Any help would be appreciated!
Submitted April 02, 2020 at 02:11AM by washedupdino
No comments:
Post a Comment