I am building a node app with express. The views are in EJS.
I have a list of EJS views. Instead of writing a different route for each of these views, is there a way to have only one dynamic route "/:dynamic_route" and then and then render the corresponding view dynamically too?
Just to be clear, I don't have/need any dynamic content in these EJS views. I only want to be able to loop through them and render the one that matches the URL I want to access. So, in the code below, how could I do it within the res.render parenthesis?
exports.viewTemplate(req, res) {
//some code to match the requested url and the corresponding view
res.render("dynamically_reference_view")
}