Add access logging
This commit is contained in:
parent
746ca6a507
commit
c69ef215b5
3 changed files with 7 additions and 1 deletions
|
@ -23,6 +23,7 @@ dependencies:
|
|||
- aeson
|
||||
- servant-server
|
||||
- wai
|
||||
- wai-logger
|
||||
- warp
|
||||
|
||||
library:
|
||||
|
|
|
@ -12,6 +12,7 @@ import Data.Aeson
|
|||
import Data.Aeson.TH
|
||||
import Network.Wai
|
||||
import Network.Wai.Handler.Warp
|
||||
import Network.Wai.Logger
|
||||
import Servant
|
||||
|
||||
data Prices = Prices
|
||||
|
@ -44,7 +45,8 @@ type API =
|
|||
:<|> Raw
|
||||
|
||||
startApp :: IO ()
|
||||
startApp = run 8080 app
|
||||
startApp = withStdoutLogger $ \logger ->
|
||||
runSettings (setPort 8080 $ setLogger logger $ defaultSettings) app
|
||||
|
||||
app :: Application
|
||||
app = serve api server
|
||||
|
|
|
@ -33,6 +33,7 @@ library
|
|||
, base >=4.7 && <5
|
||||
, servant-server
|
||||
, wai
|
||||
, wai-logger
|
||||
, warp
|
||||
default-language: Haskell2010
|
||||
|
||||
|
@ -49,6 +50,7 @@ executable tutor-exe
|
|||
, servant-server
|
||||
, tutor
|
||||
, wai
|
||||
, wai-logger
|
||||
, warp
|
||||
default-language: Haskell2010
|
||||
|
||||
|
@ -69,5 +71,6 @@ test-suite tutor-test
|
|||
, servant-server
|
||||
, tutor
|
||||
, wai
|
||||
, wai-logger
|
||||
, warp
|
||||
default-language: Haskell2010
|
||||
|
|
Loading…
Reference in a new issue