on master help sign in
Make sure tutorial can build
b3e35fbIvan Lazar Miljenovic
doc/tutorial/Docs.lhs+4
@@ -23,6 +23,7 @@ import Network.Wai
23import Servant.API
23import Servant.API
24import Servant.Docs
24import Servant.Docs
25import Servant.Server
25import Servant.Server
26+import Web.FormUrlEncoded(FromForm(..), ToForm(..))
26```
27```
27
28
28And we'll import some things from one of our earlier modules
29And we'll import some things from one of our earlier modules
@@ -218,6 +219,9 @@ type ExampleAPI2 = "position" :> Capture "x" Int :> Capture "y" Int :> Get '[JSO
218 :<|> "hello" :> QueryParam "name" String :> Get '[JSON] HelloMessage
219 :<|> "hello" :> QueryParam "name" String :> Get '[JSON] HelloMessage
219 :<|> "marketing" :> ReqBody '[JSON, FormUrlEncoded] ClientInfo :> Post '[JSON] Email
220 :<|> "marketing" :> ReqBody '[JSON, FormUrlEncoded] ClientInfo :> Post '[JSON] Email
220
221
222+instance ToForm ClientInfo
223+instance FromForm ClientInfo
224+
221exampleAPI2 :: Proxy ExampleAPI2
225exampleAPI2 :: Proxy ExampleAPI2
222exampleAPI2 = Proxy
226exampleAPI2 = Proxy
223
227
doc/tutorial/tutorial.cabal+1
@@ -31,6 +31,7 @@ library
31 , servant-docs == 0.11.*
31 , servant-docs == 0.11.*
32 , servant-js >= 0.9 && <0.10
32 , servant-js >= 0.9 && <0.10
33 , warp
33 , warp
34+ , http-api-data
34 , http-media
35 , http-media
35 , lucid
36 , lucid
36 , time
37 , time