Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Getting error while accessing the VAULT

Hi Team,

On APIGEE cloud, I have created a Vault. Now, I am trying to access the secret using NODE.js

I have gone through the link

https://github.com/apigee/apigee-access

http://docs.apigee.com/api-services/content/using-secure-store

I have written below code :-

var apigee = require('apigee-access'); var token = "";

if (apigee.getMode() === 'apigee') { // test to see if running on Edge var orgVault = apigee.getVault('gv', 'organization'); orgVault.get('gVEntry', function(err, secretValue) { if (err) { console.log(err); next(err); } else { token = secretValue; console.log("Token:"); } }); } else { if (process.argv[2]) { // if local, grab from token command line arguments token = process.argv[2]; console.log("Token no:2" + token); } console.log("Token no:1" + token); }

But I get below Error while calling the api proxy.

Script node executed prematurely: Script hello-world.js exited with status code 0

Can you please let me know if I am missing something?

Thanks and Regards,

Gaurav Bhandari

1 2 223
2 REPLIES 2