cloudfoundry-community / node-cfenv

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

no instructions how to use cfenv in angular5 app deployed in the cloud foundry #30

Closed osujii191 closed 6 years ago

osujii191 commented 6 years ago

I am unable to figure out how to use this library in angular5/typescript. I just want to run the simple command npm install @types/cfenv but that is not working....if this typing definitions cannot be provided then please provide detailed instructions how to use this library in angular5. For now I will just try use; var vcap_services = JSON.parse(process.env.VCAP_SERVICES) seems the amount of code i have to write to use this library in angular5 is alot. Please assist to create documentations for popular javascript frameworks, every javscript library creator/owner should understand that the usage of javascript frameworks is very popular now and should assist by providing great documentation on integration with these popular javascript frameworks! Thanks :-)

osujii191 commented 6 years ago

npm install @ types/cfenv --save is not working

pmuellr commented 6 years ago

I am unable to figure out how to use this library in angular5/typescript

This library was designed to be used by servers running in Cloud Foundry. From the mention of angular it sounds like you may be wanting to use this in code running in the browser. It won't work there, as cfenv is a library which interprets environment variables set in your operating system process.

I'm going to close this issue, but if I'm misunderstanding and you ARE using this in a node.js runtime and still don't understand how to use it, please re-open.

osujii191 commented 6 years ago

no instructions how to use cfenv in angular5 app deployed in the cloud foundry, the angular app is deployed in the node.js runtime environment in the cloud (pitoval cloud foundry)

pmuellr commented 6 years ago

cfenv is a module available from npm. If you don't know how to use module from npm, I can't really help you.

Otherwise, you're going to be more explicit. I think the documentation provided in the readme (available here) should be enough to use it, but if it's not, I'm not sure what you're looking for.