-
Notifications
You must be signed in to change notification settings - Fork 0
API service profiles
Marcin Słowiak edited this page Nov 11, 2018
·
3 revisions
API service got two profiles - dev and prod.
It uses H2 database - it is an in memory database which is launched when .jar starts and destroyed when .jar is stopped.
It uses real database located on private server.
Dev profile is set by default.
When you need to run service in prod profile you need to add application-prod.properties to resources directory and specify launching parameters.
There are two options how you can specify profile:
- java -jar -Dspring.profiles.active=production demo-0.0.1-SNAPSHOT.jar
- Create two configurations in 'Run configurations...'
- Open 'Run...' tab
- Open 'Edit Configurations...' option
- When window shows add via 'plus' button another configuration
- In 'Add New Configuration' choose 'Spring Boot'
- Set 'Main class' to api.AnnouncementProcessorApiApplication
- Add parameter in 'Ovveride parameters' to name: spring.profiles.active and value: prod (or dev)