Skip to content

Instantly share code, notes, and snippets.

@tasdemirbahadir
Created January 14, 2020 13:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tasdemirbahadir/2d68449814c4d7252fb1e6330074818e to your computer and use it in GitHub Desktop.
Save tasdemirbahadir/2d68449814c4d7252fb1e6330074818e to your computer and use it in GitHub Desktop.
cncm-client-controller.java
@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