0 like 0 dislike
8 views
asked by
I have multiple objects in array of locals in myroutesand would like to render each at the time so that each link works. Right now, this renders the last objects in array when I visit either link.
// routes exampleconst routes ={  path:'/posts/:id',  view:'posts',  locals:[{      id:'how-to-write-short',      title:'How to write short',      description:'The art of painting a thousand pictures with just a few words',      date:'23 Mar 2018',      issue:'1'},{      id:'the-glamour-of-grammar',      title:'The glamour of grammar',      description:'A guide to the magic and mystery of practical English',      date:'01 April 2018',      issue:'2'}]}...// serverapp.get(routes.path,function(req, res){    res.render(routes.view, routes.locals)})...

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Welcome to Our Online Community - Question and Answer, where you can ask questions and receive answers from other members of the community.
...