serverless/lib/plugins/aws/invokeLocal/fixture/handlerWithSuccess.js
Kurt Lee 50e9c5fb7d add features on AWSInvokeLocal Plugin.
1. Added support js file that has export as an data input
2. You can specify the location of handlers, such as “/dst”
3. Show JSON.parse result if Content-Type = ‘application/json’
2017-01-01 17:58:56 +09:00

23 lines
468 B
JavaScript

'use strict';
module.exports.withErrorByDone = (event, context) => {
context.done(new Error('failed'));
};
module.exports.withMessageByDone = (event, context) => {
context.done(null, 'Succeed');
};
module.exports.withMessageByLambdaProxy = (event, context) => {
context.done(null, {
statusCode: 200,
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
result: true,
message: 'Whatever',
}),
});
};