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

@ -2,8 +2,9 @@
module Main where
import qualified Database.SQLite.Simple as Db
import qualified Network.Wai.Middleware.RequestLogger as RequestLogger
import qualified Network.Wai.Middleware.Static as Static
import qualified Web.Spock.Safe as S hiding (head)
import Network.Wai.Middleware.Static
import qualified Within.DBMemorial.Post as Post
main :: IO ()
@ -16,6 +17,7 @@ main = do
-- Set up the URL router
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.text $ Post.body h

View File

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