cloudfoundry-community / node-cfenv

easy access to your Cloud Foundry application environment for node
Apache License 2.0
74 stars 20 forks source link

User Provided Environment Variables #24

Closed brentonklassen closed 4 years ago

brentonklassen commented 7 years ago

Is there a way to get User Provided Environment Variables using this package?

pmuellr commented 7 years ago

Sorry for the long delay in responding.

So you're looking for the list of "extra" env vars that have been configured for an app? I'm not sure that information is available to an app - they would typically just show up along-side all the other environment variables available to the process.

I'm wondering why you might need this - perhaps there's another way to do what you need to do ...

SrivatsanHANA commented 7 years ago

Hi @pmuellr , There are situations where in we maintain the URLs (destinations) , tenant host pattern,etc under env: destinations which show up only under user-provided section. Can you guide on what is the library /approach used to read them if cfenv doesn't support?

pmuellr commented 7 years ago

Aren't these made available to the process as plain old environment variables? So if you set an env var in your manifest named FOO, it would be accessible in Node.js as process.env.FOO or alternatively process.env["FOO"].

AdiedX commented 6 years ago

Like this:

Example process.env.ACS_CONFIG process.env.POSTGRES_DB_CONFIG

They are just regular environment variables.

pmuellr commented 6 years ago

I guess I don't know what is being asked for.

Did you want to factor these environment variables into the processing that cfenv provides? Like, somehow these environment variables get passed in the options parameter to cfenv.getAppEnv(options)?

Can you provide an example, in code/data, of

pmuellr commented 4 years ago

closing as it's inactive