New state for each user in NodeJS

Viewed 15

How can I achieve a new state for every user. And no user will encounter the other state value. For example, a sample code:

let countReq = 0;

exports.reqCount = (req, res) => {
    countReq++;
    res.status(200).send({req: countReq});
};

I want every user will get their own request count. Instead, in this scenario they are getting every user req count. Not only for this scenario, is there any way for every user req for a new state for the whole app?

0 Answers
Related