Skip to content

Commit

Permalink
Merge pull request #967 from pettyalex/fix-http-apigateway-endpoints-…
Browse files Browse the repository at this point in the history
…with-no-handler

Fix: serverless-offline crashes if a function definition does not have a handler
  • Loading branch information
dherault committed May 5, 2020
2 parents 68934c3 + fdd043d commit aefcb0e
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/ServerlessOffline.js
Expand Up @@ -293,11 +293,13 @@ export default class ServerlessOffline {
const { http, httpApi, schedule, websocket } = event

if (http || httpApi) {
httpEvents.push({
functionKey,
handler: functionDefinition.handler,
http: http || httpApi,
})
if (functionDefinition.handler) {
httpEvents.push({
functionKey,
handler: functionDefinition.handler,
http: http || httpApi,
})
}
}

if (schedule) {
Expand Down

0 comments on commit aefcb0e

Please sign in to comment.