In many MVC frameworks there is an option to invoke actions from view. For ASP.NET MVC it is called RenderAction in other frameworks such feature is called SubActions, Viewlets etc.
I need to place in EJS layout file list of latest news (comming from DB) and this should be visible in a sidebar on all views that use this layout. I don't want to duplicate logic of selecting and passing news list on every route.
Is there any clear way to do this in Express?
I haven't found any RenderAction implementation, but using app.locals
data can be shared between routes (list of latest news, for example).