config.application.yml Maven / Gradle / Ivy
The newest version!
# 基础配置
server:
port: 19090
spring:
application:
name: gateway-svr
profiles:
active: dev
config:
import:
- logging-${spring.profiles.active}.yml
cloud:
gateway:
discovery:
locator:
# 开启从注册中心动态创建路由的功能
enabled: true
# 使用小写服务名,默认是大写
lower-case-service-id: true
consul:
discovery:
instance-id: ${spring.application.name}-${spring.cloud.client.ip-address}:${server.port}
prefer-ip-address: true
config:
# 因为consul的kv路径为 ${prefixes}/${default-context}-${spring.profiles.active}/${data-key}
# 所以prod要在consul中添加 /gateway-svr-prod/data 的 key,value为application-prod.yml 文件的内容
prefixes: /
default-context: ${spring.application.name}
profile-separator: '-'
format: yaml
© 2015 - 2024 Weber Informatics LLC | Privacy Policy