我想在application.conf中定义一个变量,它将是一个字符串列表。目前在application.conf中我有这样的东西:
some.env.variable = ["a", "b"]
我试过了:
some.env.variable = ${?I_AM_ENV}.split(",")
当I_AM_ENV = a,b
时
但它没有用
加载应用时收到错误:
Wrong value type at 'some.env.variable', expecting: list but got: string
答案 0 :(得分:1)
// in your env
export OPTIONAL_A='"b", "c"'
// in application.conf
path = [ "a", ${?OPTIONAL_A} ]
应评估path
至["a", "b", "c"]
答案 1 :(得分:0)
花点时间,但我们找到了。
application.conf
access-control-allow-origin = ["http://localhost:4444"]
access-control-allow-origin = ${?CLIENT_DOMAIN}
export CLIENT_DOMAIN.0=http://localhost:3000
export CLIENT_DOMAIN.1=http://localhost:3001