From 53cf212175a7f41b3e066f23c8ed4ca4cabd7fbe Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Tue, 17 Oct 2023 23:28:13 +0600 Subject: [PATCH] fixes --- WebApp/src/jvmMain/kotlin/WebAppServer.kt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/WebApp/src/jvmMain/kotlin/WebAppServer.kt b/WebApp/src/jvmMain/kotlin/WebAppServer.kt index 8b3c943..4d61dc9 100644 --- a/WebApp/src/jvmMain/kotlin/WebAppServer.kt +++ b/WebApp/src/jvmMain/kotlin/WebAppServer.kt @@ -52,8 +52,13 @@ suspend fun main(vararg args: String) { } ) { routing { - staticFiles("", File("WebApp/build/dist/js/productionExecutable")) { - default("WebApp/build/dist/js/productionExecutable/index.html") + val baseJsFolder = File("WebApp/build/dist/js/") + baseJsFolder.list() ?.forEach { + if (it == "productionExecutable" || it == "developmentExecutable") { + staticFiles("", File(baseJsFolder, it)) { + default("WebApp/build/dist/js/$it/index.html") + } + } } post("inline") { val requestBody = call.receiveText()