Skip to content

Commit 00dd9f9

Browse files
committed
update libraries and examples
1 parent 6d75d54 commit 00dd9f9

File tree

7 files changed

+200
-183
lines changed

7 files changed

+200
-183
lines changed

CHANGELOG.md

+9
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html)
66

7+
## [4.0.2]  (2020-08-16)
8+
9+
### Changed
10+
11+
- Update dependencies
12+
- Update documentation
13+
- Update example project
14+
715
## [4.0.1]  (2020-08-11)
816

917
### Fixed
@@ -265,6 +273,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/),
265273
- Update older libraries
266274
- Now publish from Git tags instead of master pushes
267275

276+
[4.0.2]: https://github.com/manwaring/lambda-wrapper/compare/v4.0.1...v4.0.2
268277
[4.0.1]: https://github.com/manwaring/lambda-wrapper/compare/v4.0.0...v4.0.1
269278
[4.0.0]: https://github.com/manwaring/lambda-wrapper/compare/v3.7.0...v4.0.0
270279
[3.7.0]: https://github.com/manwaring/lambda-wrapper/compare/v3.6.3...v3.7.0

examples/ts/app/api.ts

+4-13
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,11 @@
11
import { api } from '@manwaring/lambda-wrapper';
22
import 'source-map-support/register';
33

4-
export const handler = api(async ({ event, path = {}, success, error }) => {
4+
export const handler = api(async ({ event, path, success, error }) => {
55
try {
6-
const { query } = path;
7-
console.log(query);
8-
const replacer = (key, value) => {
9-
switch (key) {
10-
case 'prop-to-ignore':
11-
return undefined;
12-
default:
13-
return value;
14-
}
15-
};
16-
return success(event, replacer);
6+
const { query } = path;
7+
return success({ body: { event, query } });
178
} catch (err) {
18-
return error(err);
9+
return error({ err });
1910
}
2011
});

examples/ts/app/httpApi.ts

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { httpApi } from '@manwaring/lambda-wrapper';
2+
import 'source-map-support/register';
3+
4+
export const handler = httpApi(async ({ event, path, success, error }) => {
5+
try {
6+
const { query } = path;
7+
return success({ body: { event, query } });
8+
} catch (err) {
9+
return error({ err });
10+
}
11+
});

examples/ts/package.json

+10-10
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,18 @@
77
},
88
"dependencies": {
99
"@manwaring/lambda-wrapper": "*",
10-
"source-map-support": "^0.5.10"
10+
"source-map-support": "^0.5.19"
1111
},
1212
"devDependencies": {
13-
"@types/aws-lambda": "^8.10.17",
14-
"@types/node": "^12.7.4",
15-
"rimraf": "^3.0.0",
16-
"serverless": "^1.51.0",
17-
"serverless-plugin-git-variables": "^3.3.2",
18-
"serverless-webpack": "^5.2.0",
19-
"ts-loader": "^6.0.4",
20-
"typescript": "^3.2.4",
21-
"webpack": "^4.29.0"
13+
"@types/aws-lambda": "^8.10.61",
14+
"@types/node": "^14.0.27",
15+
"rimraf": "^3.0.2",
16+
"serverless": "^1.78.1",
17+
"serverless-plugin-git-variables": "^4.0.0",
18+
"serverless-webpack": "^5.3.3",
19+
"ts-loader": "^8.0.2",
20+
"typescript": "^3.9.7",
21+
"webpack": "^4.44.1"
2222
},
2323
"author": "From Phillip with ♥",
2424
"license": "MIT"

examples/ts/serverless.yml

+7-1
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,20 @@ provider:
99
name: aws
1010
stage: example
1111
region: us-east-1
12-
runtime: nodejs10.x
12+
runtime: nodejs12.x
13+
logRetentionInDays: 14
1314
environment:
1415
LAMBDA_WRAPPER_LOG: true
1516
STAGE: ${self:provider.stage}
1617
REGION: ${self:provider.region}
1718
REVISION: ${git:sha1}
1819

1920
functions:
21+
httpApi:
22+
handler: app/httpApi.handler
23+
events:
24+
- httpApi: GET /http/hello
25+
2026
api:
2127
handler: app/api.handler
2228
events:

0 commit comments

Comments
 (0)