Company logo
  • Jobs
  • Bootcamp
  • About Us
  • For professionals
    • Home
    • Jobs
    • Courses
    • Questions
    • Teachers
    • Bootcamp
  • For business
    • Home
    • Our process
    • Plans
    • Assessments
    • Payroll
    • Blog
    • Calculator

0

116
Views
Switch between Prod and Dev environment

I've built a REST Service with Spring Boot. The setup in the development environment is different from the setup in the production environment. What is the best approach to switching setup between development environment and production environment? By setup I mean for instance the path to the database that is different in development vs. production. I can think of three approaches, use environment variables, use a properties file or use config file. Other suggestions are welcome and what I should think about when choosing.

8 months ago · Santiago Trujillo
1 answers
Answer question

0

You should have a look at Spring Profiles - see here. Using spring profile, u can easily switch configurations for the different environments.

Just name your configuration for "dev" as "application-dev.(properties|yaml) and provide -Dspring.profiles.active=dev when running the App from command line.

8 months ago · Santiago Trujillo Report
Answer question
Find remote jobs