doc: add a tip about how to serve on /
This commit is contained in:
parent
a844b7c297
commit
ecfa78d222
1 changed files with 8 additions and 0 deletions
|
@ -58,6 +58,14 @@ Let's break that down:
|
||||||
is equivalent to `/list-all/users`. This means that sometimes `:>` is somehow
|
is equivalent to `/list-all/users`. This means that sometimes `:>` is somehow
|
||||||
equivalent to `/`, but sometimes it just lets you chain another combinator.
|
equivalent to `/`, but sometimes it just lets you chain another combinator.
|
||||||
|
|
||||||
|
Tip: If your endpoint responds to `/` (the root path), just omit any combinators
|
||||||
|
that introduce path segments. E.g. the following api has only one endpoint on `/`:
|
||||||
|
|
||||||
|
``` haskell
|
||||||
|
type RootEndpoint =
|
||||||
|
Get '[JSON] User
|
||||||
|
```
|
||||||
|
|
||||||
We can also describe APIs with multiple endpoints by using the `:<|>`
|
We can also describe APIs with multiple endpoints by using the `:<|>`
|
||||||
combinators. Here's an example:
|
combinators. Here's an example:
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue