https://kotlinlang.org logo
#ktor
Title
# ktor
r

ribesg

05/10/2022, 9:57 AM
Is there no easier way to make a redirect to a different Resource when using the Resources plugin in Ktor 2 ?
Copy code
post<V1.OldPath> {
        val resources = application.plugin(Resources)
        val path = resources.resourcesFormat.encodeToPathPattern(V2.NewPath.serializer())
        call.respondRedirect(path, permanent = true)
    }
a

Aleksei Tirman [JB]

05/10/2022, 10:24 AM
@Rustam Siniukov
r

Rustam Siniukov

05/10/2022, 12:07 PM
you can use
Application.href
function instead of calling
encode
manually
👍 1
2 Views