https://kotlinlang.org logo
Title
j

John O'Reilly

01/27/2021, 8:07 PM
sorry if this is basic question but couldn't find answer in docs.....basicaly in a SPA setup I want any requests that would normally return a 404 to redirect to say main index.html....is there way to configure this in Ktor?
j

Julien Salvi

01/27/2021, 9:40 PM
I think you can do that with the StatusPage feature
c

christophsturm

01/27/2021, 9:41 PM
j

John O'Reilly

01/27/2021, 9:44 PM
Thanks @Julien Salvi @christophsturm, will take a look at those. I'd like ideally to see firstly if this can be done without pulling in 3rd party library
c

christophsturm

01/27/2021, 9:45 PM
I agree, but you can look there to see how its done
👍 1
m

Matteo Mirk

01/28/2021, 10:30 AM
Using StatusPage you can redirect to index at every 404 https://ktor.io/docs/status-pages.html#status