Update plugin version

This commit is contained in:
Alexander Nozik 2023-07-11 13:54:56 +03:00
parent 4abedcc2a2
commit 3fb1a968e5
3 changed files with 6 additions and 14 deletions

View File

@ -1,3 +1,3 @@
kotlin.code.style=official
toolsVersion=0.14.5-kotlin-1.8.20-RC
toolsVersion=0.14.9-kotlin-1.8.20

View File

@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

View File

@ -7,9 +7,7 @@ import io.ktor.http.fromFileExtension
import io.ktor.server.application.Application
import io.ktor.server.application.call
import io.ktor.server.html.respondHtml
import io.ktor.server.http.content.file
import io.ktor.server.http.content.files
import io.ktor.server.http.content.static
import io.ktor.server.http.content.staticFiles
import io.ktor.server.plugins.origin
import io.ktor.server.response.respondBytes
import io.ktor.server.routing.Route
@ -63,18 +61,12 @@ public class KtorSiteBuilder(
Path.of(it).toFile()
} catch (ex: Exception) {
//failure,
logger.error { "File $it could not be converted to java.io.File"}
logger.error { "File $it could not be converted to java.io.File" }
return@let
}
if (file.isDirectory) {
ktorRoute.static(routeName.toWebPath()) {
files(file)
}
} else {
val fileName = routeName.toWebPath()
ktorRoute.file(fileName, file)
}
ktorRoute.staticFiles(fileName, file)
//success, don't do anything else
return@files
}