lambda-api icon indicating copy to clipboard operation
lambda-api copied to clipboard

Middleware After Routes

Open JustinLutsky opened this issue 5 years ago • 0 comments

Is it possible to trigger additional, global middle-ware after routes have been run? For instance, if I wanted to inspect all response bodies for certain properties, and alter the response prior to returning according to some logic. Or if I have a number of routes that call to a DB that may return no records, and if any route logic returns null I want to change the status code to 404 and return 'Not Found'.

JustinLutsky avatar Jan 29 '20 09:01 JustinLutsky