I have a route in my Express REST-API that does some db actions. I would like to block all other calls made to the REST-API until the actions in that route have finished.
So when this route is accessed no other routes can be accessed until update-db-state finishes.
router.put('/update-db-state', (req, res) => {
... does a buch of database related stuff.
});
Is there a way to do this?