Does application.yml support environment variables?

前端 未结 2 1600
旧巷少年郎
旧巷少年郎 2021-01-30 10:04

I tried using env variables in my application.yml configration like:

spring:
  main:
    show_banner: false

---

spring:
  profiles: production
server:
  addres         


        
相关标签:
2条回答
  • 2021-01-30 10:34

    Try ${OPENSHIFT_DIY_PORT} (the usual Spring placeholder notation). See here for docs.

    0 讨论(0)
  • 2021-01-30 10:40

    You even can add default value, if environment variable not provided:

    logging:
      level:
        root: ${LOGGING_LEVEL_ROOT:info}
    
    0 讨论(0)
提交回复
热议问题