Add a createHandler function to the internal @libs/lambda package for API developers to use when creating new endpoints.
The function will check whether or not it's a warming request prior to executing the handler itself.
Technical Details
This function accepts a callback with the typical event and context parameters from API Gateway, along with a utility res object (similar to the one in Express.js) to generate a proper response object.
The CDK framework doesn't handle warming requests out of the box, but we add them to the CDK after the relevant API Gateway resources are allocated. Then we handle the warming requests with a custom, internal handler wrapper.
Summary
createHandler
function to the internal@libs/lambda
package for API developers to use when creating new endpoints.Technical Details
event
andcontext
parameters from API Gateway, along with a utilityres
object (similar to the one in Express.js) to generate a proper response object.