Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zix99/jpa-example
Simple JPA Example with postgres database
https://github.com/zix99/jpa-example
Last synced: about 1 month ago
JSON representation
Simple JPA Example with postgres database
- Host: GitHub
- URL: https://github.com/zix99/jpa-example
- Owner: zix99
- Created: 2015-07-23T16:09:28.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-08-03T15:42:27.000Z (over 9 years ago)
- Last Synced: 2023-03-03T01:37:42.312Z (almost 2 years ago)
- Language: Java
- Size: 196 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Example Simple "Identity" Service
This is a very very simple identity REST-ish service that has a backend DB. I'll be adding more to it as I go.
As time went on, this became more of my test-bed service. A lot of the libraries and integrations work just fine,
but you generally shouldn't take this as a code-style recommendation or "way of doing things".## Requirements:
NOTE: If you have a version of boot2docker 1.7.1, talk to me, we'll need to get you situated.
1. Use Brew. If you don't use brew, I won't help you
2. [brew install caskroom/cask/brew-cask](https://github.com/caskroom/homebrew-cask)
3. brew cask install virtualbox (Verify you install 5.x)
4. brew install boot2docker
5. Download the java8 jdk. We will be using 8 for all servicesWhen you install boot2docker, make sure you add the following line to your .bash_profile and/or .bashrc
eval "$(boot2docker shellinit)"## Setup:
### Create docker postgres image
1. docker pull postgres:latest
2. docker create --name postgres -p 5433:5432 -e POSTGRES_PASSWORD=testbox postgres:latest
3. docker start -a postgresWhy port 5433 for forwarding?
* Won't conflict with local postgres install
* Because I could### Modify properties
Modify the `application.properties` file to reflect the correct DB host.### Migrating the database
./gradlew flywayMigrate### Start service
./gradlew bootRun### Start tests in container
docker-compose run --rm test### Hit the endpoint
curl -X POST http://yourdockerhost:8080/identity?external_id=123&partner_id=abc