we can use this domain middleware
const Domain = require('domain');
app.use((req,res,next) => {
const d = Domain.create();
d.once('error', e => {
if(!res.headersSent){
// clean up response
}
});
d.run(next);
});