Kevin Ingwersen (Ingwie Phoenix)
unread,Jan 15, 2015, 11:42:00 AM1/15/15Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to nod...@googlegroups.com
Hey everyone.
Within my app, I have a global event object, so that all components of the app can talk to one another. However, I have linked it to Redis - so I can not use complex data when turning it into JSON. So I decided, that for pure internal use, i’d add a sub-object that runs on middlewares.
Sadly, I couldn’t find any module that would get me booted with making my own middleware based component.
Basically, I have a function that gets called before an important section of the app. This function gets the object „data“. Now, some components from the app want to modify this object and add or change something. So I want to be able to do soemthing like this:
var MyG = require(… module that offers middleware functionality …)
MyG.use(function(data, next) {
// …
next();
});
MyG.use(…)
// Now within my important function:
function(data) {
MyG.run(data);
}
Is there any module that can solve this?
Kind regards, Ingwie.