Created
August 16, 2019 02:09
-
-
Save andreybleme/43b05d2db64e50dbaa0956fce088cdec to your computer and use it in GitHub Desktop.
andreybleme.com | Centralized configuration with Spring Cloud Config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.springframework.beans.factory.annotation.Value; | |
import org.springframework.cloud.context.config.annotation.RefreshScope; | |
import org.springframework.web.bind.annotation.RequestMapping; | |
import org.springframework.web.bind.annotation.RestController; | |
@RefreshScope | |
@RestController | |
class DatabaseController { | |
@Value("${url}") | |
private String postgresURL; | |
@RequestMapping("/database") | |
public String getDatabase() { | |
return this.postgresURL; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment