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
1 changed files with 2 additions and 3 deletions

View File

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