git.iko.soy/typeable/servant-reflex
on master help sign in
Add the comprehensive api
79d18aaDoug Beardsley
exec/API.hs+25
@@ -15,3 +15,28 @@ type API = "getunit" :> Get '[JSON] ()
15 :<|> "double" :> ReqBody '[JSON] Double
15 :<|> "double" :> ReqBody '[JSON] Double
16 :> Post '[JSON] Double
16 :> Post '[JSON] Double
17 :<|> Raw
17 :<|> Raw
18+
19+type GET = Get '[JSON] ()
20+
21+-- Imported the comprehensive API example for testing.
22+-- https://github.com/haskell-servant/servant/blob/master/servant/src/Servant/API/Internal/Test/ComprehensiveAPI.hs
23+type ComprehensiveAPI =
24+ GET :<|>
25+ Get '[JSON] Int :<|>
26+ Capture "foo" Int :> GET :<|>
27+ Header "foo" Int :> GET :<|>
28+ HttpVersion :> GET :<|>
29+ IsSecure :> GET :<|>
30+ QueryParam "foo" Int :> GET :<|>
31+ QueryParams "foo" Int :> GET :<|>
32+ QueryFlag "foo" :> GET :<|>
33+-- Raw :<|>
34+ RemoteHost :> GET :<|>
35+ ReqBody '[JSON] Int :> GET :<|>
36+ Get '[JSON] (Headers '[Header "foo" Int] ()) :<|>
37+ "foo" :> GET :<|>
38+ Vault :> GET :<|>
39+ Verb 'POST 204 '[JSON] () :<|>
40+ Verb 'POST 204 '[JSON] Int
41+-- This one isn't in scope
42+-- :<|> WithNamedContext "foo" '[] GET
testserver/Main.hs+1−1
@@ -65,7 +65,7 @@ test = serve testApi server
65initApp :: SnapletInit App App
65initApp :: SnapletInit App App
66initApp = makeSnaplet "myapp" "example" Nothing $ do
66initApp = makeSnaplet "myapp" "example" Nothing $ do
67 addRoutes [("", applicationToSnap test)
67 addRoutes [("", applicationToSnap test)
68−-- ,("", serveDirectory "static")
68+ ,("", serveDirectory "static")
69 ]
69 ]
70 return App
70 return App
71
71