Skip to content

Instantly share code, notes, and snippets.

@chathurangat
Created July 16, 2018 19:21
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save chathurangat/492bd7dfa9ddb8d8fc569398d888c7ac to your computer and use it in GitHub Desktop.
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
@RefreshScope
@RestController
public class WelcomeController
{
@Value("${app.service-name}")
private String serviceName;
@GetMapping("/service")
public String getServiceName() {
return "service name [" + this.serviceName + "]";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment