This middleware adds two properties to express's res
object:
promises
- empty object for other middlewares to store promises onrenderAfterPromises
- method which waits for all promises onres.promises
to resolve before callingres.render
with promise resolutions
npm install res-promises
const express = require('express');
const resPromises = require('res-promises');
const app = express();
app.use(resPromises())
See example
dir for how to use with other middleware.
resPromises([overrideResRender])
- boolean to overrideres
'srender
method. Default method name isrenderAfterPromises