@@ -8,27 +8,28 @@ A wrap around response for aws lambda integration proxy
88
99## Response creation
10101 . Response can be created using ` response ` method
11- ```
12- var lambdaProxy = require('lambda-proxy-reponse');
13-
14- exports.handler = (event, context, callback) => {
15- // response method needs at least 3 parameters
16- // statusCode, headers, body
17- var response = lambdaProxy.response(200, { 'X-header': 'Your headers value' }, { 'bodyData': 'yourBodyData });
18-
19- // -> response = {
20- // statusCodes: 200,
21- // headers: {'X-header': 'Your headers value'},
22- // body: '{ "bodyData": "yourBodyData" }'
23- // }
24- callback(null, response);
25-
26-
27- // OR you can pass the callback to the `response` method and it will be called automatically
28- // The above implementation equal to
29- lambdaProxy.response(200, { 'X-header': 'Your headers value' }, { 'bodyData': 'yourBodyData }, callback);
30- };
31- ```
11+ ```
12+ var lambdaProxy = require('lambda-proxy-reponse');
13+
14+ exports.handler = (event, context, callback) => {
15+ // response method needs at least 3 parameters
16+ // statusCode, headers, body
17+ var response = lambdaProxy.response(200, { 'X-header': 'Your headers value' }, { 'bodyData': 'yourBodyData });
18+
19+ // -> response = {
20+ // statusCodes: 200,
21+ // headers: {'X-header': 'Your headers value'},
22+ // body: '{ "bodyData": "yourBodyData" }'
23+ // }
24+ callback(null, response);
25+
26+
27+ // OR you can pass the callback to the `response` method and it will be called automatically
28+ // The above implementation equal to
29+ lambdaProxy.response(200, { 'X-header': 'Your headers value' }, { 'bodyData': 'yourBodyData }, callback);
30+ };
31+ ```
32+
32332 . Some others shorthand method, useful for common http status
3334 - ` lambdaProxy.ok = lambdaProxy.response(200, ...) `
3435 - ` lambdaProxy.created = lambdaProxy.response(201, ...) `
0 commit comments