https://kotlinlang.org logo
#ktor
Title
# ktor
n

Nikky

12/10/2019, 5:04 PM
in my
application.conf
i have
Copy code
port = ${PORT}
this works fine on heroku and when this is set in the environment, but can i somehow set eg.
8080
as fallback ? could not find how to do that in the HOCON spec
z

zpearce

12/10/2019, 5:18 PM
it's a two line thing:
Copy code
port = 8080
port = ${?PORT}
n

Nikky

12/10/2019, 6:52 PM
oh thats almost too easy
but that seemed to not work.. it still crashes:
Copy code
Exception in thread "main" com.typesafe.config.ConfigException$UnresolvedSubstitution: application.conf @ file:/home/nikky/dev/pentagame/backend/build/resources/main/application.conf: 4: Could not resolve substitution to a value: ${PORT}
z

zpearce

12/10/2019, 7:38 PM
you need the question mark
👆 1
n

Nikky

12/11/2019, 1:57 PM
oh
8 Views