From 1c0da55a0900cc48051805aa5ea212706840293b Mon Sep 17 00:00:00 2001 From: noelwelsh Date: Thu, 1 Feb 2024 10:31:42 +0000 Subject: [PATCH] deploy: c6f224e19940e7420085143498d8261b3e8f9bd8 --- routes/index.html | 2 +- routes/paths.html | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/routes/index.html b/routes/index.html index 969acc6..d308350 100644 --- a/routes/index.html +++ b/routes/index.html @@ -73,7 +73,7 @@

Constructing A Route

Type Transformations for Handlers

If you dig into the types produced by Requests, you notice a lot of tuple types are used. Here's an example, showing a Request producing a Tuple2.

val request = Request.get(Path.root / Param.int / Param.string)
-// request: Request[*:[Int, *:[String, EmptyTuple]], Unit, Unit, Unit] = krop.route.Request@3e606b49
+// request: Request[*:[Int, *:[String, EmptyTuple]], Unit, Unit, Unit] = krop.route.Request@2cc0f214

However, when you come to use a handler with such a request, you can use a normal function with two arguments not a function that accepts a single Tuple2.

Route(request, Response.ok(Entity.text))
   .handle((int, string) => s"${int.toString}: ${string}")
diff --git a/routes/paths.html b/routes/paths.html index f95b065..548f1c9 100644 --- a/routes/paths.html +++ b/routes/paths.html @@ -71,8 +71,8 @@

Matching All Segments

// // A path is closed when it has a segment or parameter that matches all remaining elements. // A closed path cannot have additional segments of parameters added to it. -// at krop.route.Path.assertOpen(Path.scala:250) -// at krop.route.Path.$div(Path.scala:223) +// at krop.route.Path.assertOpen(Path.scala:247) +// at krop.route.Path.$div(Path.scala:220) // at repl.MdocSession$MdocApp.$init$$$anonfun$1(paths.md:41)

Params