小编Dav*_*ujo的帖子

使用本地存储库进行 Spring Cloud Config Server 配置

我正在尝试使用后端存储库(文件系统)设置 Spring Cloud Config Server,但端点(http://localhost:8888/licensingservice/default)返回以下内容:

{"name":"licensingservice","profiles":["default"],"label":null,"version":null,"state":null,"propertySources":[]}
Run Code Online (Sandbox Code Playgroud)

主要的:

@EnableConfigServer
@SpringBootApplication
public class ConfigServerApplication {

    public static void main(String[] args) {
        SpringApplication.run(ConfigServerApplication.class, args);
    }
}
Run Code Online (Sandbox Code Playgroud)

应用程序.yml:

server:
   port: 8888
spring:
   profiles:
      active: native
    cloud:
       config:
          server:
             native:
                searchLocations: file:///Users/josedavi/Desenvolvimento/WorkSpace/Pessoal/sample-spring-microservices/sample-spring-microservices/config-server/src/main/resources/config
Run Code Online (Sandbox Code Playgroud)

许可服务.yml:

tracer.property: "I AM THE DEFAULT"
spring.jpa.database: "POSTGRESQL"
spring.datasource.platform: "postgres"
spring.jpa.show-sql: "true"
spring.database.driverClassName: "org.postgresql.Driver"
spring.datasource.url: "jdbc:postgresql://database:5432/eagle_eye_local"
spring.datasource.username: "postgres"
spring.datasource.password: "p0stgr@s"
spring.datasource.testWhileIdle: "true"
spring.datasource.validationQuery: "SELECT 1"
spring.jpa.properties.hibernate.dialect: "org.hibernate.dialect.PostgreSQLDialect"
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述

服务配置的路径:

C:\Users\josedavi\Desenvolvimento\WorkSpace\Pessoal\sample-spring-microservices\sample-spring-microservices\config-server\src\main\resources\config
Run Code Online (Sandbox Code Playgroud)

项目: https: //github.com/jdavid-araujo/sample-spring-microservices

spring spring-boot spring-cloud spring-cloud-config

6
推荐指数
1
解决办法
2万
查看次数