Ryan Brink
01/21/2024, 7:47 PMapplication.environment.rootPath
value has been removed... is there a new way to identify the root path? asking b/c Kompendium needs this value in order to calculate the value of the root path for a route
fun Route.calculateRoutePath() = toString()
.let {
application.environment.rootPath.takeIf { root -> root.isNotEmpty() } // <- invalid in 3.0
?.let { root ->
val sanitizedRoute = if (root.startsWith("/")) root else "/$root"
it.replace(sanitizedRoute, "")
}
?: it
}
.replace(Regex("/\\(.+\\)"), "")
.replace(Regex("/\\[.+\\]"), "")
Aleksei Tirman [JB]
01/22/2024, 7:31 AMApplication
object: application.rootPath