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

hyukchan

01/21/2019, 12:40 PM
Does someone know how to use multiple conf files for Ktor project ?
r

robin

01/21/2019, 12:43 PM
Is using
include
statements in your
application.conf
an option? Have a look at this: https://github.com/lightbend/config/blob/master/HOCON.md#include-semantics-file-formats-and-extensions
Basically, you can include additional config files in your
application.conf
by doing any variety of this:
Copy code
include "overrides.conf"

include require("overrides.conf") // Throws when file can't be found

include url("<http://example.com/overrides.conf|example.com/overrides.conf>")

include "overrides" // Loads any overrides.conf, overrides.json or overrides.properties
h

hyukchan

01/21/2019, 12:46 PM
Yeah it should work. It's simply to have multiple files instead of a 2000 lines of conf in the same file.
Thanks a lot 🙂
r

robin

01/21/2019, 12:47 PM
No problem!
In general, having read the HOCON specification opens up a lot of additional possibilities that aren't obvious from the little you see in the Ktor docs. It's a good read!
h

hyukchan

01/21/2019, 12:52 PM
Yeah, I'll try to read the link you sent me on HOCON, thanks a lot 🙂
76 Views