renaming route into mode (for clarity and homogenization)

This commit is contained in:
akhesaCaro 2022-02-21 11:48:38 +01:00
parent 485b2530c1
commit ece559ee6e

View File

@ -22,12 +22,12 @@ import Servant.Server.Generic
``` ```
The usage is simple, if you only need a collection of routes. The usage is simple, if you only need a collection of routes.
First you define a record with field types prefixed by a parameter `route`: First you define a record with field types prefixed by a parameter `mode`:
```haskell ```haskell
data Routes route = Routes data Routes mode = Routes
{ _get :: route :- Capture "id" Int :> Get '[JSON] String { _get :: mode :- Capture "id" Int :> Get '[JSON] String
, _put :: route :- ReqBody '[JSON] Int :> Put '[JSON] Bool , _put :: mode :- ReqBody '[JSON] Int :> Put '[JSON] Bool
} }
deriving (Generic) deriving (Generic)
``` ```