https://kotlinlang.org logo
Title
m

Mehdi

09/21/2020, 2:06 PM
I am wondering How can I pass Environment setting to a http4k application using gadlew?
d

dave

09/21/2020, 2:12 PM
If you want to use typesafe 12-factor configuration then have a look at the examples repo. As for passing values from Gradle - there's nothing special about http4k in that regard, so the Gradle docs are your best bet. 🙃
m

Mehdi

09/21/2020, 3:00 PM
btw How can I switch to Environment.defaults() if no env has been provided? I mean something similar to Spring Boot properties app.foo=${BAR_ENV:foo}
d

dave

09/21/2020, 4:30 PM
You need to provide an Environment. There are functions on the companion object to give you these
(Environment.ENV imwill pick up from the local environment)