【问题标题】:Getting list of file names from GIT repo from Spring cloud config server从 Spring 云配置服务器的 GIT 存储库中获取文件名列表
【发布时间】:2020-02-06 23:16:15
【问题描述】:

我正在使用带有 GIT 的 Spring 云配置服务器,它按预期工作。

现在,我的要求是从 spring 云服务器获取文件名列表。

Spring cloud config 只提供像http://localhost:8088/myconfig/default/master/config.properties 这样的API 来获取属性值。

是否有任何 API 可用于获取所有文件名?如果没有,替代方法是什么?

【问题讨论】:

    标签: java spring spring-boot spring-cloud-config


    【解决方案1】:

    不,很遗憾,这是不可能的。我们在项目中所做的方式 - 在 config.properties 中添加具有所需文件名的属性,并使用

    在代码中获取文件

    /{name}/{profile}/{label}/{path} 的附加端点

    https://cloud.spring.io/spring-cloud-config/reference/html/#_serving_plain_text

    【讨论】:

      猜你喜欢
      • 2021-03-29
      • 2019-10-26
      • 2015-04-07
      • 2019-03-13
      • 2019-07-01
      • 1970-01-01
      • 2017-02-23
      • 2021-03-17
      • 2018-05-15
      相关资源
      最近更新 更多