Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/arose13/heroku-spring-postgres-example
This is an example of a Heroku Postgres Database Example
https://github.com/arose13/heroku-spring-postgres-example
Last synced: 8 days ago
JSON representation
This is an example of a Heroku Postgres Database Example
- Host: GitHub
- URL: https://github.com/arose13/heroku-spring-postgres-example
- Owner: arose13
- Created: 2015-09-26T13:11:58.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2015-10-05T03:17:25.000Z (about 9 years ago)
- Last Synced: 2024-10-07T06:40:41.374Z (about 1 month ago)
- Language: Java
- Homepage:
- Size: 281 KB
- Stars: 4
- Watchers: 4
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Heroku-Database-Example
REST controls:
- ('/people') prints the list of all people in the DB
- ('/add/{name}') save the {name} to the DB
- ('/get/{name}') gets a particular person by name from the DB- You can run this locally by going to commandline and in the project directory calling
```
$ gradle bootrun
```# How to set up Heroku
You'll need to set a SPRING_CLOUD_APP_NAME environment variable because it Heroku doesn't just give this to you like other platforms. Also set the SPRING_PROFILES_ACTIVE environment variable and name it the same profile you've given it in the code. In my case I've called it 'cloud'.
```
$ heroku create --stack cedar
$ heroku addons:create heroku-postgresql
$ heroku config:set SPRING_CLOUD_APP_NAME={HEROKU-APPNAME-1234}
$ heroku config:set SPRING_PROFILES_ACTIVE=cloud
```# Goal
Get a pure Java (XML free) Postgres DB project to work on Heroku.
PS: to run projects on Heroku you'll need a 'Procfile'