Aria Stewart wrote:
On 28 Feb 2015, at 06:31, Satish B<[email protected]>  wrote:
[…]
I want to know if variables inside the route are also shared between the users? 
I guess the req object makes it a separate instance for each user.
I've not got a proper way to test this, so asking the community.


They are not, generally, if you mean a 'route' as in this:

app.get('/path', function (req, res) {
     var thisvariablerighthere = 1;
});

Do note the presence of the “var” keyword. Without it, you may well be accessing global state.

Perhaps running node in strict mode is a good idea? Put "use strict"; at the top of your scripts to turn it on.

– Harald

--
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- You received this message because you are subscribed to the Google Groups "nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/54F31D27.4080306%40math.ntnu.no.
For more options, visit https://groups.google.com/d/optout.

Reply via email to