I would like to do the following:
var globVar={}
globVar[usr]=["Values"];
function1(usr){
//calculations with globVar[usr]
}
function2(usr){
//calculations with globVar[usr]
}
app.post('/', function(req, res) {
var formString = req.body.filter1;
usr= req.connection.user;
globVar[usr].push(formString);
function1(usr);
function2(usr);
res.redirect('/');
});
usr=req.connection.user comes from nodeSSPI module. I need to make this globVar depending on usr so globalVar doesn't get mixed up when users runs this app concurrently. Now it works well but only for single user :)
Now when I start the app usr is not defined. Any ide how to get it's value from route on app initialization?
Thank you for your consideration on this matter.
via plska
No comments:
Post a Comment