From 9cb7029ca580e915ba3dae4695e81a5986e2a59a Mon Sep 17 00:00:00 2001 From: Daniel Sellers Date: Tue, 24 Mar 2020 15:15:53 -0600 Subject: [PATCH] Adds support for httpApi This patch adds support for the new httpApi that aws offers for reducing cost and latency in serverless applications. It has been supported for a while in serverless, this just adds support here to match. The approach is pretty straightforward so far and may not include all of the functionality that httpApi permits so far. Those will come in later patches to this pull request. --- src/ServerlessOffline.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ServerlessOffline.js b/src/ServerlessOffline.js index 764a82ccd..624f26992 100644 --- a/src/ServerlessOffline.js +++ b/src/ServerlessOffline.js @@ -292,13 +292,13 @@ export default class ServerlessOffline { const events = service.getAllEventsInFunction(functionKey) events.forEach((event) => { - const { http, schedule, websocket } = event + const { http, httpApi, schedule, websocket } = event - if (http) { + if (http || httpApi) { httpEvents.push({ functionKey, handler: functionDefinition.handler, - http, + http: http || httpApi, }) }