Jan
07/15/2022, 5:50 PMget("/") {
call.respondText(ContentType.Text.Html) {
"""
<!DOCTYPE html>
<html lang="en">
<head>
<title>Supabase In App Authentication</title>
</head>
<body>
<script>
const pairs = location.hash.substring(1).split("&").map(pair => pair.split("="))
</script>
</body>
</html>
""".trimIndent()
}
}
Is there a good way without using templates or something?Eric Grimsborn
07/17/2022, 2:45 AMkotlinx.html
https://ktor.io/docs/html-dsl.html#html_response
It is not templating but rather a way of writing typesafe html with code. You would have something like this instead
call.respondHtml {
head {
title("Supabase In App Authentication")
}
body {
script {
unsafe { // will not escape the text
+"""const pairs = location.hash.substring(1).split("&").map(pair => pair.split("="))"""
}
}
}
}