Skip to content

Commit

Permalink
fix(router): compatibility matched params
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Apr 7, 2022
1 parent e45f024 commit 07930bc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,10 @@ export function createRouter (): Router {
}

// Add params
event.event.context.params = matched.params || {}
const params = matched.params || {}
event.event.context.params = params
// @ts-ignore Compatibility
event.req.context.params = event.event.params
event.req.context.params = params

// Call handler
return handler(event)
Expand Down

0 comments on commit 07930bc

Please sign in to comment.