Skip to content
This repository has been archived by the owner on Nov 27, 2019. It is now read-only.

Commit

Permalink
Merge pull request #3 from Travelport-Ukraine/path-params
Browse files Browse the repository at this point in the history
Added handling of path params.
  • Loading branch information
shmuga authored Jul 24, 2018
2 parents 1b18339 + 0613ea0 commit 20ca4fc
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function R(...params) {
Promise.resolve(data)
.then(usedSettings.validate)
.then(() =>
handler(Object.assign({}, data, {
handler(Object.assign({}, data, event.pathParameters, {
context,
headers: lowercaseKeys(event.headers),
authorizer: event.requestContext && event.requestContext.authorizer,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "aws-response",
"version": "1.6.0",
"version": "1.6.1",
"description": "AWS response handler",
"main": "lib/index.js",
"scripts": {
Expand Down
3 changes: 3 additions & 0 deletions test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ describe('Test handling request', () => {
expect(data).to.be.deep.equal(Object.assign(
{},
event.queryStringParameters,
{
path1: 'ok',
},
{
authorizer: undefined,
headers: lowercaseKeys(event.headers),
Expand Down
3 changes: 3 additions & 0 deletions test/sample-requests/GET-request-aws.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
"param1": "ok",
"param2": "okok"
},
"pathParameters": {
"path1": "ok"
},
"requestContext": {
"accountId": "",
"apiId": "",
Expand Down

0 comments on commit 20ca4fc

Please sign in to comment.