Create your free Redis Cloud account. Follow this link to create Redis Cloud subscription and database as shown below:
Save the database endpoint URL and password for future reference.
If you are using Heroku for the first time, create your new Heroku account through this link
brew install heroku
heroku login
heroku: Press any key to open up the browser to login or q to exit:
Opening browser to https://cli-auth.heroku.com/auth/cli/browser/XXXXXXXXXXA
Logging in... done
Logged in as your_email_address
For this demonstration, we will be using a Sample Rate Limiting application
git clone https://github.com/redis-developer/basic-rate-limiting-demo-java
heroku create
Creating app... done, ⬢ hidden-woodland-03996
https://hidden-woodland-03996.herokuapp.com/ | https://git.heroku.com/hidden-woodland-03996.git
Go to Heroku dashboard, click "Settings" and set
REDIS_ENDPOINT_URI
and REDIS_PASSWORD
under the
Config Vars. Refer to Step 1 for reference.
You now have a functioning Git repository that contains a simple application as well as a package.json file, which is used by Node’s dependency manager.
Heroku generates a random name (in this case hidden-woodland-03996) for your app, or you can pass a parameter to specify your own app name. Now deploy your code:
$ git push heroku
remote: BUILD SUCCESSFUL in 1m 5s
remote: 12 actionable tasks: 12 executed
remote: -----> Discovering process types
remote: Procfile declares types -> web
remote:
remote: -----> Compressing...
remote: Done: 298.9M
remote: -----> Launching...
remote: Released v3
remote: https://hidden-woodland-03996.herokuapp.com/ deployed to Heroku
remote:
remote: Verifying deploy... done.
To https://git.heroku.com/hidden-woodland-03996.git
* [new branch] master -> master
Open https://hidden-woodland-03996.herokuapp.com/ to see your application