I am currently working on an Express REST-API route that involves various database actions. My goal is to prevent any other calls from being made to the REST-API until the actions within this particular route have been completed.
When this route is accessed, I want to ensure that no other routes can be accessed until the update-db-state function finishes processing.
router.put('/update-db-state', (req, res) => {
... performs multiple database-related tasks.
});
Is there a way to achieve this synchronization in Express?