You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
var openwhisk = require('openwhisk');
console.log(process.env['__OW_API_KEY']);
// blows up here....
var ow = openwhisk();
function main(params) {
console.log(process.env['__OW_API_KEY']);
// ...but this would work.
var ow = openwhisk();
return { message: 'Hello World' };
}
I've just helped another user who ran into this issue. I'm going to add a note to the client library README to call this behaviour out but I can imagine it's going to continue to trip people up.
Environment details:
IBM Bluemix (US-South).
Steps to reproduce the issue:
This action demonstrates the issue.
Additional information you deem important:
__OW_API_KEY
is not defined until the the invocation occurs.The user cannot define the openwhisk client outside the handler function without explicitly providing both the api key and host endpoint.
Would it be possible to move the variables apart from
deadline
andactivation_id
to the handler init section?If this isn't possible, this behaviour should be documented.
The text was updated successfully, but these errors were encountered: