我正在使用带有 GIT 的 Spring 云配置服务器,它按预期工作正常。
现在,我的要求是从 Spring Cloud 服务器获取文件名列表。
Spring cloud config仅提供像http://localhost:8088/myconfig/default/master/config.properties这样的API来获取属性值。
有没有API可以获取所有文件名?如果没有,替代方法是什么?
最佳答案
不,不幸的是这是不可能的。我们在项目中所做的方式 - 在 config.properties 中添加具有所需文件名的属性,并使用
在代码中获取文件additional endpoint at /{name}/{profile}/{label}/{path}
https://cloud.spring.io/spring-cloud-config/reference/html/#_serving_plain_text
关于java - 从Spring云配置服务器获取GIT存储库的文件名列表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58307170/