examples: add GS6
This commit is contained in:
parent
1d3eefaf48
commit
ec95cb0355
2 changed files with 20 additions and 0 deletions
18
servant-examples/getting-started/GS6.hs
Normal file
18
servant-examples/getting-started/GS6.hs
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
{-# LANGUAGE DataKinds #-}
|
||||||
|
{-# LANGUAGE TypeFamilies #-}
|
||||||
|
{-# LANGUAGE TypeOperators #-}
|
||||||
|
module GS6 where
|
||||||
|
|
||||||
|
import Network.Wai
|
||||||
|
import Servant
|
||||||
|
|
||||||
|
type API = "code" :> Raw
|
||||||
|
|
||||||
|
api :: Proxy API
|
||||||
|
api = Proxy
|
||||||
|
|
||||||
|
server :: Server API
|
||||||
|
server = serveDirectory "getting-started"
|
||||||
|
|
||||||
|
app :: Application
|
||||||
|
app = serve api server
|
|
@ -7,6 +7,7 @@ import qualified GS2
|
||||||
import qualified GS3
|
import qualified GS3
|
||||||
import qualified GS4
|
import qualified GS4
|
||||||
import qualified GS5
|
import qualified GS5
|
||||||
|
import qualified GS6
|
||||||
|
|
||||||
app :: String -> Maybe Application
|
app :: String -> Maybe Application
|
||||||
app n = case n of
|
app n = case n of
|
||||||
|
@ -15,6 +16,7 @@ app n = case n of
|
||||||
"3" -> Just GS3.app
|
"3" -> Just GS3.app
|
||||||
"4" -> Just GS4.app
|
"4" -> Just GS4.app
|
||||||
"5" -> Just GS5.app
|
"5" -> Just GS5.app
|
||||||
|
"6" -> Just GS6.app
|
||||||
_ -> Nothing
|
_ -> Nothing
|
||||||
|
|
||||||
main :: IO ()
|
main :: IO ()
|
||||||
|
|
Loading…
Reference in a new issue