Implement a page that displays the "Hello for the first time!" on the first visit, and "Hello" on the next visits.
What code should you put instead of the three dots in the handler code?
routing {
get("/greeting") {
...
}
}Implement a page that displays the "Hello for the first time!" on the first visit, and "Hello" on the next visits.
What code should you put instead of the three dots in the handler code?
routing {
get("/greeting") {
...
}
} if(call.request.cookies["notfirst"].toBoolean())
}
call.respondText("Hello")
call.respondText("Hello for the first time!")
call.response.cookies.append("notfirst", "true")
else {
Create a free account to access the full topic