Log requests to standard out

This commit is contained in:
Christine Dodrill 2015-07-28 07:28:03 -07:00
parent 2173c47696
commit 60ab03761e
2 changed files with 8 additions and 5 deletions

View File

@ -1,10 +1,11 @@
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE OverloadedStrings #-}
module Main where module Main where
import qualified Database.SQLite.Simple as Db import qualified Database.SQLite.Simple as Db
import qualified Web.Spock.Safe as S hiding (head) import qualified Network.Wai.Middleware.RequestLogger as RequestLogger
import Network.Wai.Middleware.Static import qualified Network.Wai.Middleware.Static as Static
import qualified Within.DBMemorial.Post as Post import qualified Web.Spock.Safe as S hiding (head)
import qualified Within.DBMemorial.Post as Post
main :: IO () main :: IO ()
main = do main = do
@ -16,6 +17,7 @@ main = do
-- Set up the URL router -- Set up the URL router
S.runSpock 5000 $ S.spockT id $ do S.runSpock 5000 $ S.spockT id $ do
S.middleware (staticPolicy (addBase "public")) S.middleware $ Static.staticPolicy $ Static.addBase "public"
S.middleware $ RequestLogger.logStdout
S.get S.root $ S.get S.root $
S.text $ Post.body h S.text $ Post.body h

View File

@ -63,6 +63,7 @@ executable time-wasting-thread-memorial
, text >=1.2.1.1 , text >=1.2.1.1
, blaze-html >=0.8.0.2 , blaze-html >=0.8.0.2
, wai-middleware-static >=0.7.0.1 , wai-middleware-static >=0.7.0.1
, wai-extra >=1.3.0
-- Directories containing source files. -- Directories containing source files.
hs-source-dirs: src hs-source-dirs: src