Feature Request: allow adding another middleware array optional param, to be executed at the end of the chain
Korayem opened this issue · comments
Suggestion:
import { compose } from 'next-api-compose'
export default compose([preWithBar, preWithFoo], [postWithBar, postWithFoo], (request, response) => {
const { foo, bar } = request
response.status(200).json({ foo, bar })
})
Some of the reasons:
- Logging
- APM performance tracing
- fetch.waitUntil() to trigger custom business logic (purge/refresh cache, CRUD events)
- Analytics
- HTTP Edge Cache storage of the response body