application.yml 1.32 KB
spring:
  cloud:
    gateway:
      globalcors:
        cors-configurations:
          '[/**]':
            allowedOrigins: "*"
            allowedMethods:
              - ALL
      discovery:
        locator:
          enabled: true
          lower-case-service-id: true
    consul:
      # 服务发现配置
      discovery:
        # 启用服务发现
        enabled: true
        # 启用服务注册
        register: true
        # 服务停止时取消注册
        deregister: true
        # 表示注册时使用IP而不是hostname
        prefer-ip-address: true
        # 执行监控检查的频率
        health-check-interval: 30s
        # 设置健康检查失败多长时间后,取消注册
        health-check-critical-timeout: 30s
        # 健康检查的路径
        health-check-path: /actuator/info
        # 服务注册标识,格式为:应用名称:服务器IP:端口
        instance-id: ${spring.application.name}:${spring.cloud.consul.discovery.ip-address}:${server.port}
        ip-address: 192.168.9.146
  datasource:
    driver-class-name: com.mysql.cj.jdbc.Driver
    url: jdbc:mysql://192.168.9.233:3306/fanxing3
    username: root
    password: 123456
  redis:
    host: localhost
    port: 6379
    password: vionredis
    database: 2
logging:
  config: classpath:logback-${spring.profiles.active}.xml