next-api-decorators
next-api-decorators copied to clipboard
refactor: Support AsyncLocalStorage
This PR refactor the handler code (middlewares and main API function). The change is to run all functions in one Promise instead of creating a Promise for each middleware.
The Motivation is to support AsyncLocalStorage in order to have a context object cross all middlewares and the main API function.
Thanks.