Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
removing mode explaination
Browse files Browse the repository at this point in the history
akhesaCaro authored and MangoIV committed Apr 26, 2024
1 parent 4a3888e commit 8bde7de
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions doc/cookbook/namedRoutes/NamedRoutes.lhs
Original file line number Diff line number Diff line change
@@ -240,10 +240,6 @@ movieHandler movieId = MovieAPI
```
As you might have noticed, we build our handlers out of the same record types we used to define our API: `MoviesAPI` and `MovieAPI`. What kind of magic is this ?
Remember the `mode` type parameter we saw earlier? Since we need to transform our API type into a _server_, we need to provide a server `mode`, which is `AsServerT Handler` here.
You can alternatively use the AsServer (= AsServerT Handler) type alias. If you need to define handlers in some specific App monad from your codebase, the mode would simply be changed to AsServerT App.
Finally, we can run the server and connect the API routes to the handlers as usual:
``` haskell
@@ -268,8 +264,6 @@ movieCatalogClient :: API (AsClientT ClientM)
movieCatalogClient = client api -- remember: api :: Proxy MovieCatalogAPI
```
Have you noticed the `mode` `AsClient ClientM`?
We’ve also introduced some operators that help navigate through the nested records.
`(//)` is used to jump from one record to another.

0 comments on commit 8bde7de

Please sign in to comment.