File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -11,5 +11,7 @@ executable server
1111 build-depends : base ^>= 4.12.0.0
1212 , servant-server
1313 , time
14+ , wai
15+ , warp
1416 hs-source-dirs : src
1517 default-language : Haskell2010
Original file line number Diff line number Diff line change 11{-# LANGUAGE DataKinds #-}
22{-# LANGUAGE DeriveGeneric #-}
3+ {-# LANGUAGE TypeApplications #-}
34{-# LANGUAGE TypeOperators #-}
45{-# OPTIONS_GHC -Wall #-}
56
67module Main where
78
9+ import Data.Proxy (Proxy (Proxy ))
810import Data.Time (Day )
911import GHC.Generics (Generic )
12+ import Network.Wai (Application )
13+ import Network.Wai.Handler.Warp (run )
1014import Servant
1115 ( (:<|>)
1216 , (:>)
1317 , Capture
1418 , Get
1519 , JSON
20+ , serve
1621 )
1722
1823data User = User
@@ -34,5 +39,8 @@ type UsersAPI =
3439 " users"
3540 :> (UsersIndex :<|> UsersShow )
3641
42+ usersApp :: Application
43+ usersApp = serve (Proxy @ UsersAPI ) _usersServer
44+
3745main :: IO ()
38- main = putStrLn " Hello, Haskell! "
46+ main = run 8080 usersApp
You can’t perform that action at this time.
0 commit comments