Skip to content

Display Cloud Foundry environment variables in a simple webapp

Notifications You must be signed in to change notification settings

samof76/cf-env

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Display Cloud Foundry environment variables

A simple Sinatra application. Once deployed to Cloud Foundry, it will echo the Environment and HTTP Request Headers.

This is especially useful to learn about service connection details ($VCAP_SERVICES) being passed to an application. Create them, bind them to this running application, and you'll see the nested JSON string that is set in $VCAP_SERVICES.

Deploy

The repo contains a manifest file which creates a new application called cfenv, with a random string in the URL to avoid collisions.

To deploy:

$ cf push
Using manifest file manifest.yml

Creating cfenv... OK

Creating route cfenv-dfe2f.cfapps.io... OK
Binding cfenv-dfe2f.cfapps.io to cfenv... OK
Uploading cfenv... OK
Starting cfenv... OK
-----> Downloaded app package (64K)
-----> Using Ruby version: ruby-1.9.3
-----> Installing dependencies using Bundler version 1.3.2
       Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin --deployment
       Fetching gem metadata from https://rubygems.org/..........
       Fetching gem metadata from https://rubygems.org/..
       Installing json_pure (1.8.0)
       Installing rack (1.5.2)
       Installing rack-protection (1.5.0)
       Installing tilt (1.4.1)
       Installing sinatra (1.4.3)
       Using bundler (1.3.2)
       Your bundle is complete! It was installed into ./vendor/bundle
       Cleaning up the bundler cache.
-----> Uploading droplet (24M)
Checking cfenv...
Staging in progress...
Staging in progress...
Staging in progress...
  1/1 instances: 1 running
OK
$ open http://cfenv-dfe2f.cfapps.io

About

Display Cloud Foundry environment variables in a simple webapp

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 100.0%