git.iko.soy/typeable/servant
on master help sign in
factor in @alp's feedbacks on PR #1455
commit8b93af3d12261d36240191478e54357d705a5a07 authorbChiquet <contrib-servant@binarytrove.com> dateWed 29 Sep 2021, 19:59 (5 years ago) parent29aa101
1 file changed+7−7
doc/tutorial/ApiType.lhs+7−7
doc/tutorial/ApiType.lhs+7−7
@@ -390,10 +390,10 @@ with the rest of your API. But you can plug in everything that is an
390390`Application`, e.g. a whole web application written in any of the web
391391frameworks that support `wai`.
392392
393−Be mindful! This library works by pattern-matching the different routes that are
394−composed using `:<|>`. `Raw`, as an escape hatch, matches any route that hasn't
395−been matched by previous patterns. Therefore, any subsequent route will be silently
396−ignored.
393+Be mindful! The `servant-server`'s router works by pattern-matching the
394+different routes that are composed using `:<|>`. `Raw`, as an escape hatch,
395+matches any route that hasn't been matched by previous patterns. Therefore,
396+any subsequent route will be silently ignored.
397397
398398``` haskell
399399type UserAPI14 = Raw
@@ -403,12 +403,12 @@ type UserAPI14 = Raw
403403 -- endpoint matches requests before
404404```
405405A simple way to avoid this pitfall is to either use `Raw` as the last
406−definition, or to always have it under a directory.
406+definition, or to always have it under a static path.
407407
408408``` haskell
409409type UserAPI15 = "files" :> Raw
410− -- The raw endpoint is under a directory,
411− -- so it won't match /users.
410+ -- The raw endpoint is under the /files
411+ -- static path, so it won't match /users.
412412 :<|> "users" :> Get '[JSON] [User]
413413
414414type UserAPI16 = "users" :> Get '[JSON] [User]