This commit is contained in:
2026-08-30 14:06:35 +03:00
parent 995c5fba0e
commit d75172434e
7 changed files with 155 additions and 33 deletions
@@ -6,10 +6,14 @@ import io.ktor.server.application.Application
import io.ktor.server.cio.CIO as ServerCIO
import io.ktor.server.engine.embeddedServer
actual fun createHttpClient(): HttpClient = HttpClient(CIO)
actual fun createHttpClient(): HttpClient = HttpClient(CIO) {
engine {
requestTimeout = UPSTREAM_REQUEST_TIMEOUT_MS
}
}
actual fun startServer(port: Int, module: Application.() -> Unit) {
embeddedServer(ServerCIO, port = port, host = "0.0.0.0") {
actual fun startServer(host: String, port: Int, module: Application.() -> Unit) {
embeddedServer(ServerCIO, port = port, host = host) {
module()
}.start(wait = true)
}