forked from serverless/serverless-helpers-js
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.js
More file actions
29 lines (23 loc) · 601 Bytes
/
index.js
File metadata and controls
29 lines (23 loc) · 601 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/**
* Serverless Helpers JS
*/
var ServerlessHelpers = {
// Load Environment Variables
loadEnv: function() {
require('./env');
},
// Retrieve CF output variables
// For now has to be called AFTER loadEnv() as we need
// the SERVERLESS variables to compose the CF stack name.
CF: require('./CF'),
// Shim interacting with Lambda to a callback call
shimCallback: function(method) {
return function (event, context) {
method(event, function (err, val) {
return context.done(err, val);
});
}
}
};
// Export
module.exports = ServerlessHelpers;