For example, I have a page /locations/map which I need to include Google Map library, and include a .js file (e.g. location.js) specif
/locations/map
I discover other way to do that
In MapController.js
// you can add as many as you like res.locals.scripts = [ '//maps.googleapis.com/maps/api/js', ]; return res.view();
In layout.ejs
<% if (scripts) { %> <% for (i = 0; i < scripts.length; i++) { %> <% } %> <% } %>