doc: add a tip about how to serve on `/`
commitecfa78d2228a0d52381bf7eb4ebe2673840c96fe
authorSönke Hahn <soenkehahn@gmail.com>
dateFri 15 Jul 2016, 19:31 (10 years ago)
parenta844b7c
doc/tutorial/ApiType.lhs+8
@@ -58,6 +58,14 @@ Let's break that down:
5858 is equivalent to `/list-all/users`. This means that sometimes `:>` is somehow
5959 equivalent to `/`, but sometimes it just lets you chain another combinator.
6060
61+Tip: If your endpoint responds to `/` (the root path), just omit any combinators
62+that introduce path segments. E.g. the following api has only one endpoint on `/`:
63+
64+``` haskell
65+type RootEndpoint =
66+ Get '[JSON] User
67+```
68+
6169We can also describe APIs with multiple endpoints by using the `:<|>`
6270combinators. Here's an example:
6371