Bernhard
02/21/2024, 1:18 PMjava -jar fat.jar --test="hi"
to KTOR so I can read inside my routesAleksei Tirman [JB]
02/21/2024, 1:21 PMJava.lang.System.getenv
method:
TEST=hi java -jar fat.jar
Sam
02/21/2024, 1:21 PM-P
flag to create a custom config property, like mentioned at the bottom of this section: https://ktor.io/docs/configuration-file.html#command-lineBernhard
02/21/2024, 1:22 PMktor {
deployment {
port = 8080
}
}
media {
dir = "aadfsdf"
}
when I start the server inside intellij, environment.config.propertyOrNull("media.dir") is nullBernhard
02/21/2024, 1:23 PM-P:media.dir=/data
to override this defaultBernhard
02/21/2024, 1:25 PMfun Application.configureRouting() {
println(environment.config.propertyOrNull("media.dir"))
}
it's always null thoughBernhard
02/21/2024, 1:27 PMAleksei Tirman [JB]
02/21/2024, 1:33 PMmain
function?Bernhard
02/21/2024, 1:33 PMfun main() {
embeddedServer(Netty, port = 8080, host = "127.0.0.1", module = Application::module)
.start(wait = true)
}
Bernhard
02/21/2024, 1:33 PMBernhard
02/21/2024, 1:34 PMBernhard
02/21/2024, 1:35 PMAleksei Tirman [JB]
02/21/2024, 1:35 PMapplication.conf
isn't loaded with that configuration. You need to use EngineMain.Aleksei Tirman [JB]
02/21/2024, 1:35 PMBernhard
02/21/2024, 1:35 PM