Skip to content

Commit 3cfb56d

Browse files
SamanShafighbrettstack
authored andcommitted
doc(example): update api_backend example to use ES6 arrow function immediate return (aws#446)
Since this code is using ES6 we can use the short version of returning a param
1 parent e1fcea6 commit 3cfb56d

File tree

1 file changed

+1
-7
lines changed
  • examples/2016-10-31/api_backend/src

1 file changed

+1
-7
lines changed

examples/2016-10-31/api_backend/src/index.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,7 @@ const dynamo = new AWS.DynamoDB.DocumentClient();
66

77
const tableName = process.env.TABLE_NAME;
88

9-
const createResponse = (statusCode, body) => {
10-
11-
return {
12-
statusCode: statusCode,
13-
body: body
14-
}
15-
};
9+
const createResponse = (statusCode, body) => ({ statusCode, body });
1610

1711
exports.get = (event, context, callback) => {
1812

0 commit comments

Comments
 (0)