Giter VIP home page Giter VIP logo

Comments (8)

cf-gitbot avatar cf-gitbot commented on July 28, 2024

We have created an issue in Pivotal Tracker to manage this. You can view the current status of your issue at: https://www.pivotaltracker.com/story/show/115421377.

from nodejs-buildpack.

Dannyzen avatar Dannyzen commented on July 28, 2024

Hi @pkumar-appd thanks for reaching out. We'd like to help but want to make sure that we're not duplicating issue #41. Can you please explain how this question is different from that issue?

from nodejs-buildpack.

pkumar-appd avatar pkumar-appd commented on July 28, 2024

@Dannyzen Its different from previous query as now the extension is ready. Its written in python. The issue #41 was regarding which language needs to be selected for writing extension for nodejs BP.

from nodejs-buildpack.

Dannyzen avatar Dannyzen commented on July 28, 2024

Excellent. If the issue is solved, please close it. From what I understand you are attempting to obtain the value of an environmental variable. This use case is not Cloud Foundry specific and in the interest of exposing you to more helpful knowledge I'd like to refer you to the "Application Port" section of the node-tips document where the example provides sample syntax.

If this is not your question, please do let me know.

from nodejs-buildpack.

jtarchie avatar jtarchie commented on July 28, 2024

These are environment variables that are available at the runtime of your code are also available in your nodejs code.

In javascript,

var vcap_application = JSON.parse(process.env.VCAP_APPLICATION)
var vcap_services  = JSON.parse(process.env.VCAP_SERVICES)

That way you don't need to write them to a file.

What makes you think that the environment variables are not persisted across the different scripts?

from nodejs-buildpack.

pkumar-appd avatar pkumar-appd commented on July 28, 2024

@jtarchie Thanks for the reply.
I am able to fetch the environment variables using python. I am also using JSON library.
But to make use of them currently i am writing a require statement in .js file in /tmp directory and then executing it before node server.js command.(A Start command of my application, mentioned in package.json)

The VCAP_SERVICES has appdynamics controller specific details (Eg: hostname, account-name, account-access-key etc)
But do we have any other way where i don't need to write these details into a file.

from nodejs-buildpack.

jtarchie avatar jtarchie commented on July 28, 2024

I'm not understanding where the disconnect is happening. You are asking about accessing environment variables. If you have a script that requires the data in VCAP_SERVICES you read directly from the environment variable in that script. Instead of reading from a file, read from the environment variable, directly.

from nodejs-buildpack.

pkumar-appd avatar pkumar-appd commented on July 28, 2024

@jtarchie @Dannyzen Thanks for the help.
I am not longer storing the values of VCAP_SERVICES and VCAP_APPLICATION into /tmp dir.

from nodejs-buildpack.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.