Skip to content

Example Cloud Foundry application for use with Pivotal Redis service

Notifications You must be signed in to change notification settings

tylerphelan/cf-redis-example-app

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CF Redis Example App Build Status

This app is an example of how you can consume a Cloud Foundry service within an app.

It allows you to set, get and delete Redis key/value pairs using RESTful endpoints.

Getting Started

Using Pivotal Redis service

Install the app by pushing it to your Cloud Foundry and binding with the Pivotal Redis service

Example:

 $ git clone [email protected]:pivotal-cf/cf-redis-example-app.git
 $ cd cf-redis-example-app
 $ cf push redis-example-app --no-start
 $ cf create-service p-redis development redis
 $ cf bind-service redis-example-app redis
 $ cf start redis-example-app

Using Redis-Labs CUPS

Install the app by pushing it to your Cloud Foundry and binding with a Redis-Labs CUPS

You will need to sign up for redis-as-a-service and then provide the credetials of your redis instance when running cf cups.

Example:

 $ git clone [email protected]:pivotal-cf/cf-redis-example-app.git
 $ cd cf-redis-example-app
 $ cf push redis-example-app --no-start
 $ cf cups redis -p "host, password, port"
 $ cf bind-service redis-example-app redis
 $ cf restage redis-example-app
 $ cf start redis-example-app

Endpoints

PUT /:key

Sets the value stored in Redis at the specified key to a value posted in the 'data' field. Example:

$ export APP=redis-example-app.my-cloud-foundry.com
$ curl -X PUT $APP/foo -d 'data=bar'
success

GET /:key

Returns the value stored in Redis at the key specified by the path. Example:

$ curl -X GET $APP/foo
bar

DELETE /:key

Deletes a Redis key spcified by the path. Example:

$ curl -X DELETE $APP/foo
success

GET /config/:item

Returns the Redis configuration value at the key specified by the path. Example:

$ curl -X GET $APP/config/max_clients
100

About

Example Cloud Foundry application for use with Pivotal Redis service

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 100.0%