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

mudasar187

08/01/2022, 11:36 AM
Hi! Could people help me with hint of why i should use HOCON file or not and make the config in code? I am new to Ktor and i want to hear some experience from people in here 🙂
a

Andromadus Naruto

08/01/2022, 9:41 PM
For me, I have a few points: 1. Single source of truth for your configuration 2. Human-readable configuration 3. Ability to set default values for keys that might not have been set.
a

Aleksei Tirman [JB]

08/02/2022, 7:43 AM
Another argument for is that you don’t need to recompile your project to change some settings.
👍🏾 1
m

mudasar187

08/02/2022, 7:49 AM
So like Springboot have @Profile I can use HOCON to set what config to use when run dev prod or local?
a

Aleksei Tirman [JB]

08/02/2022, 7:51 AM
Unfortunately, there is no such feature in Ktor.
m

mudasar187

08/02/2022, 7:55 AM
I would be AWESOME if Ktor will make a feature with switching profiles 🙂
3 Views