How can I make it so I host the website & the backend in the ktor app. I was thinking of static content and then XMLHTTPRequest to access the backend api:
ktor app
+-----------
/ -> public/index.html (has assets that also need to be accessible from the /public folder)
/security -> public/security.html (has assets that also need to be accessible from the /public folder)
/api -> handled by the api using GET, POST, etc. functions
How should my routes look?
EDIT: I tried this but it didn't really work. /api returned correctly but / and /index.html or any other asset in /public did not show up.
get("/api") {
call.respondText("works")
}
static {
resource("/", "public/index.html")
resource("*", "public/index.html")
resources("public")
}