kodeshare/src/main/kotlin/moe/kageru/kodeshare/config/Config.kt
2019-09-29 17:18:38 +02:00

24 lines
620 B
Kotlin

package moe.kageru.kodeshare.config
import com.uchuhimo.konf.Config
import com.uchuhimo.konf.ConfigSpec
val config = Config {
addSpec(DatabaseSpec)
addSpec(ServerSpec)
}.from.properties.file("kodeshare.properties")
.from.env()
object DatabaseSpec : ConfigSpec() {
val port by optional(3306)
val password by required<String>()
val user by optional("kodeshare")
val database by optional("kode")
}
object ServerSpec : ConfigSpec() {
val port by optional(9092)
// this is needed to return full URLs when uploading via curl and for the AboutPage
val domain by required<String>()
}