Answer the question
In order to leave comments, you need to log in
Is Expressjs Single Threaded?
Let's say I have an expressjs server. There is an apishka that returns something:
router.get('/test', async (req: Request, res: Response) => {
return res.json(await ConstantsDao.get())
})
let A; - вот тут
router.get('/test', async (req: Request, res: Response) => {
return res.json(await ConstantsDao.get())
})
Answer the question
In order to leave comments, you need to log in
It will be the same, yes, but I do not recommend doing this if you decide to use this variable as a fast in-memory cache. Because in this case, your API becomes not scalable, because. the value of variable A may then be different for different nodes.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question