Answer the question
In order to leave comments, you need to log in
Where to store the value of a variable for node.js to access it permanently?
There is a script which can be executed very long. It is necessary during its operation to write down a variable somewhere so that you can refer to it from another request. (track progress)
For example:
app.post('/one', (req, res) => {
var i = 146
console.log(i) -146
}
app.post('/two', (req, res) => {
console.log(i) -146
}
Answer the question
In order to leave comments, you need to log in
Key-value storage: memcached, Redis for these tasks. and you need to start using Websockets when you need to start receiving events from the server
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question