Skip to content
This repository has been archived by the owner on Jul 2, 2020. It is now read-only.

Commit

Permalink
fix: dev pack support apigw (#137)
Browse files Browse the repository at this point in the history
  • Loading branch information
echosoar committed Apr 22, 2020
1 parent 5865c73 commit 53158d7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions packages/gateway-common-http/src/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,14 @@ export async function parseInvokeOptionsByOriginUrl(
Object.keys(functions).forEach((functionName) => {
const functionItem = functions[functionName] || {};
const event = (functionItem.events || []).find((eventItem: any) => {
return eventItem.http;
return eventItem.http || eventItem.apigw;
});
if (event?.http) {
const eventItem = event?.http || event?.apigw;
if (eventItem) {
urlMatchList.push({
functionName,
originRouter: event?.http?.path || '/*',
router: event?.http?.path?.replace(/\/\*$/, '/**') || '/**',
originRouter: eventItem.path || '/*',
router: eventItem.path?.replace(/\/\*$/, '/**') || '/**',
});
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ functions:
test3:
handler: test3.handler
events:
- http:
- apigw:
path: /api/*
test4:
handler: test4.handler
Expand Down

0 comments on commit 53158d7

Please sign in to comment.