forked from maiora/backend-api
Compare commits
2 Commits
42b61c24ff
...
5be3bea4d0
Author | SHA1 | Date | |
---|---|---|---|
5be3bea4d0 | |||
b49577804e |
@ -13,13 +13,15 @@ import java.io.FileInputStream
|
|||||||
import java.util.*
|
import java.util.*
|
||||||
|
|
||||||
fun main() {
|
fun main() {
|
||||||
embeddedServer(Netty, port = 8098, host = "0.0.0.0", module = Application::module)
|
val properties = loadConfig()
|
||||||
.start(wait = true)
|
val port = properties.getProperty("server.port").toInt()
|
||||||
|
embeddedServer(Netty, port = port, host = "0.0.0.0") {
|
||||||
|
module(properties)
|
||||||
|
}.start(wait = true)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun Application.module() {
|
fun Application.module(configFile: Properties) {
|
||||||
val config = ApplicationConfig("application.conf")
|
val config = ApplicationConfig("application.conf")
|
||||||
val configFile = loadConfig()
|
|
||||||
val dbUrl = configFile.getProperty("ktor.database.url")
|
val dbUrl = configFile.getProperty("ktor.database.url")
|
||||||
val username = configFile.getProperty("ktor.database.username")
|
val username = configFile.getProperty("ktor.database.username")
|
||||||
val password = configFile.getProperty("ktor.database.password")
|
val password = configFile.getProperty("ktor.database.password")
|
||||||
|
Loading…
Reference in New Issue
Block a user