Sample Node.js Application with a Redis Backend

Run Locally

Start a local Redis server.

redis-server --requirepass testing123 --port 6379

Install necessary libraries.

npm install express
npm install redis

Run it.

node src/app.js

In a second terminal, curl the endpoint.

curl http://127.0.0.1:3000/foo

output

{"key":"bar"}

Run on CloudFoundry

cf push