examples
examples copied to clipboard
Is it possible to share variable between functions? (nodejs)
Hello,
My serverless.yml
hello:
handler: handler.hello
events:
- http:
path: hello
method: get
authorizer: authorizerFunc
authorizerFunc:
handler: handler.authorizerFunc
What I want is to set some value in auth.js
and get the value in handler.js
auth.js
module.exports.authorizerFunc = (event, context, callback) => {
//set some value
});
handler.js
module.exports.hello = (event, context, callback) => {
//get that value
});
Is it possible ?