Community

cfenv 1.0.0 with new getServiceCreds() method

Share this post:

I’ve updated the node.js cfenv package at npm:

  • moved from the netherworld of 0.x.y versioned packages to version 1.0.0
  • updated some of the package dependencies
  • added a new appEnv.getServiceCreds(spec) method

In case you’re not familiar with the cfenv package, it’s intended to be the Swiss army knife of handling your Cloud Foundry runtime environment variables,
including: PORT, VCAP_SERVICES, and VCAP_APPLICATION.

Here’s a quick example that doesn’t including accessing services in
VCAP_SERVICES:

You can start your server with this kind of snippet, which provides the
correct port, binding address, and url of the running server; and it will
run locally as well as on CloudFoundry.

For more information, see the cfenv readme.

new API appEnv.getServiceCreds(spec)

Lately I’ve been finding myself just needing the credentials property value from
service objects. To make this just a little bit easier than:

you can now do this, using the new
appEnv.getServiceCreds(spec)
API:

No need to get the whole service if you don’t need it, and you don’t have to
type out credentials all the time 🙂

what else?

What other gadgets does cfenv need? If you have thoughts, don’t hesitate
to open an issue, send a pull request, etc.

Add Comment
No Comments

Leave a Reply

Your email address will not be published.Required fields are marked *

More How-tos Stories

How do I monitor my IBM Cloud applications?

If you are a service owner or first responder, you ask yourself "What’s going on with my IBM Cloud application?", "Are my customers satisfied with the service they’re getting?", "Has performance changed recently?" and so on. The answer begins with your organization's plan to design, deliver, operate, and control the IT and cloud services that it offers. This first post of the series begins with monitoring your cloud-based applications.

Continue reading

Tutorials to get your mobile development up and running

Recently, we announced new tutorials to get you started on IBM Cloud. In continuation of our effort to bring in structured and well-defined tutorials, we are adding a mobile section

Continue reading

Container builds with multiple stages in IBM Cloud Container Registry

The IBM Cloud Container Registry team has been working to enable users to run their container builds in IBM Cloud. This capability was available to users of single containers or container groups, and we’re proud to announce that now cluster users can use it too. We’ve also taken the opportunity to add some new features. There’s a new command, bx cr build, and I’d like to highlight one of the new features that can help simplify your container builds.

Continue reading