Update plugin version
This commit is contained in:
parent
4abedcc2a2
commit
3fb1a968e5
@ -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
|
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@ -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
|
||||
|
@ -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)
|
||||
}
|
||||
val fileName = routeName.toWebPath()
|
||||
ktorRoute.staticFiles(fileName, file)
|
||||
//success, don't do anything else
|
||||
return@files
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user