To change Express view folder based on where is the file that res.render() is called with Node.js, we call the res.render
method with the template path.
For instance, we write
app.get("/your/path", (req, res) => {
res.render(__dirname + "/folder/with/views/viewname");
});
to call res.render
with the path to the template as in the route handler for the /your/path route.