@wilyarti not quite; actually the opposite. I use
defaultResource("index.html", "static")
for serving my
index.html
page on
/
, however, HTML5 history works by changing the URL client side.
For example, my SPA may have a route for
/login
, however, this route is
not present in ktor - the route only exists in Vue. HTML5 history requires that any paths that would have resulted in a 404, instead serve the
index.html
- so if a user were to refresh
/login
it ktor should just return
index.html
and Vue will handle the route accordingly.
@avolkmann no dice,
file("{...}", "index.html")
in my
static {}
block I only see a 404 for routes undefined in ktor (e.g.
/noroute
). I tried your other suggestions, but I've so far been unsuccessful.
The closest I've been able to get is this, but it just returns
index.html
for
everything 😛
I hoped that the routing would have been smart enough to execute the tailcard last, but this doesn't seem to be the case.