Hi! Where can I find an exhaustive explanation about choosing between HOCON and Code configuration? I don't quite understand which way is more preferred.
➕ 1
j
Joost Klitsie
04/18/2021, 8:44 PM
To me it looks like it's easier to use environment variables with the hocon config
f
Fi5t
04/19/2021, 8:12 AM
Yeah, it looks a little more comfortable. But I wanted to found a more "formal" description to use this approach in production =)
j
Joost Klitsie
04/19/2021, 9:43 AM
Copy code
For EngineMain, Ktor loads its configuration from an external file that uses the HOCON format. This way provides more flexibility to configure a server and allows you to change a configuration without recompiling your application. Moreover, you can run your application from a command line and override the required server parameters by passing corresponding command-line arguments.