porta server su file esterno
This commit is contained in:
parent
8242c78b35
commit
b49577804e
@ -13,13 +13,15 @@ import java.io.FileInputStream
|
||||
import java.util.*
|
||||
|
||||
fun main() {
|
||||
embeddedServer(Netty, port = 8098, host = "0.0.0.0", module = Application::module)
|
||||
.start(wait = true)
|
||||
val properties = loadConfig()
|
||||
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 configFile = loadConfig()
|
||||
val dbUrl = configFile.getProperty("ktor.database.url")
|
||||
val username = configFile.getProperty("ktor.database.username")
|
||||
val password = configFile.getProperty("ktor.database.password")
|
||||
|
Loading…
Reference in New Issue
Block a user