mirror of
https://github.com/haskell-servant/servant-ekg.git
synced 2024-11-26 21:19:43 +01:00
Merge branch 'servant-auto'
This commit is contained in:
commit
38df4598f8
1 changed files with 18 additions and 18 deletions
36
test/test.hs
36
test/test.hs
|
@ -1,23 +1,23 @@
|
||||||
{-# LANGUAGE DataKinds #-}
|
{-# LANGUAGE DataKinds #-}
|
||||||
{-# LANGUAGE PolyKinds #-}
|
{-# LANGUAGE DeriveGeneric #-}
|
||||||
{-# LANGUAGE TypeFamilies #-}
|
|
||||||
{-# LANGUAGE DeriveGeneric #-}
|
|
||||||
{-# LANGUAGE TypeOperators #-}
|
|
||||||
{-# LANGUAGE OverloadedStrings #-}
|
|
||||||
{-# LANGUAGE OverlappingInstances #-}
|
{-# LANGUAGE OverlappingInstances #-}
|
||||||
|
{-# LANGUAGE OverloadedStrings #-}
|
||||||
|
{-# LANGUAGE PolyKinds #-}
|
||||||
|
{-# LANGUAGE TypeFamilies #-}
|
||||||
|
{-# LANGUAGE TypeOperators #-}
|
||||||
|
|
||||||
import Control.Concurrent
|
import Control.Concurrent
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
import Data.Monoid
|
import Data.Monoid
|
||||||
import Data.Proxy
|
import Data.Proxy
|
||||||
import Data.Text
|
import Data.Text
|
||||||
import GHC.Generics
|
import GHC.Generics
|
||||||
import Network.Wai
|
import Network.Wai
|
||||||
import Network.Wai.Handler.Warp
|
import Network.Wai.Handler.Warp
|
||||||
import System.Metrics
|
import Servant
|
||||||
import Servant
|
import System.Metrics
|
||||||
|
|
||||||
import Servant.Ekg
|
import Servant.Ekg
|
||||||
|
|
||||||
-- * Example
|
-- * Example
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ server = helloH :<|> postGreetH :<|> deleteGreetH
|
||||||
helloH name (Just False) = return . Greet $ "Hello, " <> name
|
helloH name (Just False) = return . Greet $ "Hello, " <> name
|
||||||
helloH name (Just True) = return . Greet . toUpper $ "Hello, " <> name
|
helloH name (Just True) = return . Greet . toUpper $ "Hello, " <> name
|
||||||
|
|
||||||
postGreetH greet = return greet
|
postGreetH = return
|
||||||
|
|
||||||
deleteGreetH _ = return ()
|
deleteGreetH _ = return ()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue