To add your own middleware to the bootstrap use the following function:
const NextBootstrap = require('@dpdk/bootstrap');
const bootstrap = new NextBootstrap(__dirname, process.cwd(), nextConfig, config);
bootstrap.addMiddleware((req, res, next) => {
// Custom code here
next();
});
bootstrap.init();
Additional Express Middleware Documentation: http://expressjs.com/en/guide/using-middleware.html
Last modified | Friday, April 30, 2021, 12:00:21 PM UTC |
Last author | Colin van Eenige |
Commit ID | 4c7a701 |