Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.