add opportunity to set port different with 8080 in WebAppServer sample

This commit is contained in:
InsanusMokrassar 2023-04-19 21:46:35 +06:00
parent c6019b1862
commit 3925ef9423

View File

@ -43,14 +43,13 @@ suspend fun main(vararg args: String) {
val bot = telegramBot(telegramBotAPIUrlsKeeper) val bot = telegramBot(telegramBotAPIUrlsKeeper)
createKtorServer( createKtorServer(
"0.0.0.0", "0.0.0.0",
8080, args.getOrNull(2) ?.toIntOrNull() ?: 8080,
additionalEngineEnvironmentConfigurator = { additionalEngineEnvironmentConfigurator = {
parentCoroutineContext += Dispatchers.IO parentCoroutineContext += Dispatchers.IO
} }
) { ) {
routing { routing {
static { staticFiles("", File("WebApp/build/distributions")) {
files(File("WebApp/build/distributions"))
default("WebApp/build/distributions/index.html") default("WebApp/build/distributions/index.html")
} }
post("inline") { post("inline") {