@@ -35,7 +35,7 @@ response.
3535[source, kotlin, role="secondary"]
3636----
3737{
38- get("/") { ctx ->
38+ get("/") {
3939 val token = ctx.header("token").value() // <1>
4040
4141 val headers = ctx.headers() // <2>
@@ -74,7 +74,7 @@ Request cookies are send to the server using the `Cookie` header, but we do prov
7474[source, kotlin, role="secondary"]
7575----
7676{
77- get("/") { ctx ->
77+ get("/") {
7878 val token = ctx.cookie("token").value() // <1>
7979
8080 val = ctx.cookieMap(); // <2>
@@ -111,15 +111,15 @@ Path parameter are part of the `URI`. To define a path variable you need to use
111111[source,kotlin,role="secondary"]
112112----
113113{
114- get("/{id}") { ctx -> ctx .path("id").value() } // <1>
114+ get("/{id}") { ctx.path("id").value() } // <1>
115115
116- get("/@{id}") { ctx -> ctx .path("id").value() } // <2>
116+ get("/@{id}") { ctx.path("id").value() } // <2>
117117
118- get("/file/{name}.{ext}") { ctx -> cxt.path("name") + "." + ctx.path("ext") } // <3>
118+ get("/file/{name}.{ext}") { cxt.path("name") + "." + ctx.path("ext") } // <3>
119119
120- get("/file/*") { ctx -> ctx .path("*") } // <4>
120+ get("/file/*") { ctx.path("*") } // <4>
121121
122- get("/{id:[0-9]+}") { ctx -> ctx .path("id) } // <5>
122+ get("/{id:[0-9]+}") { ctx.path("id) } // <5>
123123}
124124----
125125
@@ -151,7 +151,7 @@ Path parameter are part of the `URI`. To define a path variable you need to use
151151[source, kotlin, role="secondary"]
152152----
153153{
154- get("/{name}") { ctx ->
154+ get("/{name}") {
155155 val pathString = ctx.pathString() // <1>
156156
157157 val path = ctx.path() // <2>
@@ -226,7 +226,7 @@ class SearchQuery {
226226[source, kotlin, role="secondary"]
227227----
228228{
229- get("/search") { ctx ->
229+ get("/search") {
230230 val queryString = ctx.queryString() // <1>
231231
232232 val query = ctx.query() // <2>
@@ -316,7 +316,7 @@ class User {
316316[source, kotlin, role="secondary"]
317317----
318318{
319- post("/user") { ctx ->
319+ post("/user") {
320320 val form = ctx.form() // <1>
321321
322322 val formMap = ctx.formMultimap() // <2>
@@ -390,7 +390,7 @@ class User {
390390[source, kotlin, role="secondary"]
391391----
392392{
393- post("/user") { ctx ->
393+ post("/user") {
394394 val multipart = ctx.multipart() // <1>
395395
396396 val multipartMap = ctx.multipartMultimap() // <2>
@@ -474,7 +474,7 @@ a javadoc:Session[] but the lifecycle is shorter: *data is kept for only one req
474474.Kotlin
475475[source,kotlin,role="secondary"]
476476----
477- get("/") {ctx ->
477+ get("/") {
478478 ctx.flash("success").value("Welcome!") <3>
479479 }
480480
0 commit comments