Created
January 14, 2020 13:07
-
-
Save tasdemirbahadir/2d68449814c4d7252fb1e6330074818e to your computer and use it in GitHub Desktop.
cncm-client-controller.java
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
@SpringBootApplication | |
@RestController | |
public class ConfigClient { | |
@Value("${user.role}") | |
private String role; | |
public static void main(String[] args) { | |
SpringApplication.run(ConfigClient.class, args); | |
} | |
@GetMapping( | |
value = "/whoami/{username}", | |
produces = MediaType.TEXT_PLAIN_VALUE) | |
public String whoami(@PathVariable("username") String username) { | |
return String.format("Hello! | |
You're %s and you'll become a(n) %s...\n", username, role); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment