Skip to content

Commit

Permalink
Fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
noelwelsh committed Jul 10, 2024
1 parent 9e30dac commit 79a597e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/src/pages/routes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ val route = Route(Request.get(Path / "user" / Param.int), Response.ok(Entity.tex
[Request](request.md) and [Response](response.md) have separate pages, so here we'll just discuss the handler. There are three ways to create a handler: using `handle`, `handleIO`, or `passthrough`. Assume the request produces a value of type `A` and the response needs a value of type `B`. Then these three methods have the following meaning:

- `handle` is a function `A => B`;
- `handle` is a function `A => IO[B]`; and
- `handleIO` is a function `A => IO[B]`; and
- `passthrough`, which can only be called when `A` is the same type as `B`, means that the output of the request is connected directly to the input of the response. This is useful, for example, when the response is loading a static file from the file system, and the request produces the name of the file to load.


### 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`.
If you dig into the types produced by `Requests` you will notice a lot of tuple types are used. Here's an example, showing a `Request` producing a `Tuple2`.

```scala mdoc
val request = Request.get(Path / Param.int / Param.string)
Expand Down

0 comments on commit 79a597e

Please sign in to comment.