GithubHelp home page GithubHelp logo

isabella232 / cf-redis-example-app Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pivotal-cf/cf-redis-example-app

0.0 0.0 0.0 12.82 MB

Example Cloud Foundry application for use with Pivotal Redis service

License: Apache License 2.0

Ruby 100.00%

cf-redis-example-app's Introduction

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 dedicated-vm 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 credentials 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":"redis_host","password":"redis_password","port":"redis_port"}'
 $ cf bind-service redis-example-app redis
 $ 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

cf-redis-example-app's People

Contributors

avade avatar balakaza avatar cghsystems avatar dependabot-preview[bot] avatar dependabot-support avatar duncwinn avatar edwardecook avatar gerhard avatar goonzoid avatar jacknewberry avatar jimbo459 avatar jplebre avatar mariantalla avatar mirahimage avatar pcf-redis avatar steve-sienk avatar tinygrasshopper avatar zvance avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.