天天看点

四、SpringBoot之yml多代码块,配置不同环境

server:
  port: 8088
  servlet-path: /study-springboot-hello
spring:
  profiles:
    active: dev
---
server:
  port: 8081
spring:
  profiles: active
---
server:
  port: 8080
spring:
  profiles: dev
           

以---分开不同的代码块。spring:profiles: active  设置环境。

spring: profiles:  active: dev  若设置就是指定环境,不设置就是默认环境。

继续阅读