https://kotlinlang.org logo
Title
n

Nikky

10/19/2019, 5:03 PM
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

wilyarti

10/20/2019, 5:34 AM
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

Nikky

10/20/2019, 8:01 AM
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

wilyarti

10/20/2019, 8:25 AM
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.