using static content <https://ktor.io/servers/feat...
# ktor
n
using static content https://ktor.io/servers/features/static-content.html can i do
static("/")
and access files from the root of the jar ? it seems like when i do that the requests do not match
w
The static resources are usually in a directory like resources/static. You can use shadowjar to compile the entire app including static files into a single jar file.
n
yes i do that.. as
static("static") { resources("html") }
it works.. i am trying to get requests to
/index.html
to work though (instead of
/static/index.html
)
w
static("/") { resources("static") } That is what I do on my web app to achieve what you are after.
It will treat the resources/static directory as the root / directory.