I am using the Ejs templating engine for my expressjs project and despite passing my objects along to my view blog.ejs file, I am receiving an blogpost not defined
You're not passing an array variable called blogpost
to your template, you are instead passing these variables to your template:
title: blogpost.title,
author: blogpost.author,
content: blogpost.content,
date: blogpost.date
You could just do this render()
instead of the one you currently have:
res.render('pages/blog', {
blogpost: blogpost,
});