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

fix: dev pack support apigw #137

Merged
merged 1 commit into from
Apr 22, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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