mirror of
https://github.com/serverless/serverless.git
synced 2025-12-08 19:46:03 +00:00
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’
23 lines
468 B
JavaScript
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',
|
|
}),
|
|
});
|
|
};
|