Skip to content

Instantly share code, notes, and snippets.

@kamisrini
Created December 16, 2018 20:14
  • 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 kamisrini/0575374e608b7cbf658611a4704a79b8 to your computer and use it in GitHub Desktop.
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@SpringBootApplication
public class AiMainAppApplication {
public static void main(String[] args) {
SpringApplication.run(AiMainAppApplication.class, args);
}
}
@RefreshScope
@RestController
class MessageRestController {
@Value("${message:Hello from local}")
private String message;
@RequestMapping("/message")
String getMessage() {
return this.message;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment