-1

I have one requirement to indicate the user that they are using a development environment or test environment or production environment on UI. I need suggestion on this which will be more robust and requires less maintenance.

Thanks in advance.

Deepak Sharma
  • 109
  • 2
  • 12

1 Answers1

0

One option is to use the Spring Profiles, one for each environment that you have.

For example you can have profiles for: development, qa, uat and production and the only that you need to pass to your application is a property like

-Dspring.profiles.active="<<environment_that_you_want>>"

Then to show on your views (if you're using spring mvc and tymeleaf) you can follow this explanation

Hope it helps.

Community
  • 1
  • 1
Gerard Ribas
  • 717
  • 1
  • 9
  • 17