Tag: profiles

  • How to write REST APIs for specific environments in Spring Boot?

    Let’s say you want to write a REST API in Spring Boot and you also want it to be accessible only in specific environments , say development environment and not in test or production environments. How can you achieve this in Spring Boot? By using the @Profile annotation! Spring Boot has the provision to create…

  • How to run environment specific code in Spring Boot?

    Let’s say you want to run environment specific code in your Spring Boot application. Say if the environment is local , you get data from a temporary cache and if the environment is anything higher you get it from a third party service. How to do this? You can specify the environment to be activated…