Last active
October 27, 2019 19:34
-
-
Save marcusvieira88/cca0920f1792f2fe1d52889e3d00ec46 to your computer and use it in GitHub Desktop.
Spring Cloud Config Client ConfigController.java
This file contains hidden or 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
package tech.marcusvieira.springconfigmicroservice.controllers; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.web.bind.annotation.GetMapping; | |
import org.springframework.web.bind.annotation.RestController; | |
import tech.marcusvieira.springconfigmicroservice.configs.Configuration; | |
import tech.marcusvieira.springconfigmicroservice.resource.ConfigResource; | |
@RestController | |
public class ConfigController { | |
@Autowired | |
private Configuration configuration; | |
@GetMapping(name = "/configs") | |
public ConfigResource getConfigs() { | |
return new ConfigResource(configuration.getConfigA(), configuration.getConfigB()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment