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.

More stories

Create Dynamic Rules for Access Groups

Users or admins can now dynamically create access rules on the IBM Cloud Platform based on identity information shared from their Enterprise Identity Provider.

Continue reading

Configuring IBM Cloud App ID From the Toolchain

Learn how to configure the IBM Cloud App ID from a toolchain as part of continuous delivery process. This post gives some background and the script we use.

Continue reading

Part III: Wimbledon Facebook Bot on IBM Cloud

Delivering at scale: In the final part of the series, we discuss integrations with on-site systems at the All England Club and how we used Multi-Region within IBM Cloud to ensure scale and availability.

Continue reading