1.0.0 • Published 7 years ago
serverless-offline-global-exporter v1.0.0
Serverless Offline Global Exporter Plugin
Export all lambda functions to process.env
npm install --save-dev serverless-offline-global-exporterOn your plugins declaration
plugins:
- serverless-offline-global-exporter
- serverless-offlineAll declared functions in your serverless.yml will be accessible in process.env.SERVERLESS_FUNCTIONS
functions:
hello:
handler: mymodule.myhandler
memorySize: 128
timeout: 30const functionsList = JSON.parse(process.env.SERVERLESS_FUNCTIONS);
const lambdaToInvoke = functionsList[options['FunctionName']];
const lambda = require(lambdaToInvoke['mymodule']);
return lambda[lambdaToInvoke['myhandler']]({foo: 'bar'}, {}, callback);1.0.0
7 years ago