我已经使用 spring 开发了配置服务器。
我的 Application.java 是
@EnableConfigServer
@SpringBootApplication
public class SpringConfigServerApplication {
public static void main(String[] args) {
SpringApplication.run(SpringConfigServerApplication.class, args);
}}
Run Code Online (Sandbox Code Playgroud)
我的 bootstrap.properties 文件
#Server port
server.port = 8888
#Git repo location
spring.cloud.config.server.git.uri=file://Users/dineth/Documents/MyProjects/sample-git-sources/config-server-repo
Run Code Online (Sandbox Code Playgroud)
我的 config-server-client-development.properties 文件
msg = Hello world - this is from config server – Development environment.
Run Code Online (Sandbox Code Playgroud)
我已经触发了 git init、git add 和 git commit 命令来将我的文件添加到本地 git。
但是当我运行应用程序并转到http://localhost:8888/client-config/development
它没有显示我的财产价值。
// 20200406064430
// http://localhost:8888/client-config/development
{
"name": "client-config",
"profiles": [
"development"
],
"label": null,
"version": "4f989b109d1e6d77c8f44a664b275305ddddf014",
"state": null,
"propertySources": [ …Run Code Online (Sandbox Code Playgroud)