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

Get the most out of Salesforce

CRM systems are critical for enterprises. They allow business users to more easily access and manage customer information and records customer interactions from multiple channels. CRM systems also automate workflows and provide tracking, performance and productivity information.

Continue reading

Top 5 Highlights from VMworld 2017

With VMworld US & Europe coming to a close, we’re taking a look back into activities and announcements that took place over the past couple of weeks. Below is a recap of some of the most exciting stories for those who didn’t get a chance to hear the news on the ground.

Continue reading

Monitoring & logging for IBM Bluemix Container Service with Sematext

In this blog post we discuss how Sematext integrates with IBM Bluemix Container Service to provide monitoring and logging visibility of your containerized applications, as they run in production. In the sections below, we demonstrate how to set up a Kubernetes cluster in Bluemix and how to set up Sematext in this cluster. IBM Cloud has monitoring and logging capabilities in the platform, but we know our customers operate in a multi-cloud or hybrid cloud environment and we are very excited to partner with Sematext, enabling operational consistency across those environments. We worked with Alen Komljen, an Automation Engineer from Sematext, to create the following content and perform the technology validation.

Continue reading