From 98e0b03fb4be3b1da0ea7f95da6348f3a2370034 Mon Sep 17 00:00:00 2001 From: Jasper Van der Jeugt Date: Sun, 31 Jul 2016 15:53:50 +0200 Subject: Enable listings and indices in the preview server Fixes #457 --- src/Hakyll/Preview/Server.hs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/Hakyll/Preview/Server.hs b/src/Hakyll/Preview/Server.hs index ca02e2b..a84016a 100644 --- a/src/Hakyll/Preview/Server.hs +++ b/src/Hakyll/Preview/Server.hs @@ -24,11 +24,12 @@ staticServer :: Logger -- ^ Logger -> IO () -- ^ Blocks forever staticServer logger directory host port = do Logger.header logger $ "Listening on http://" ++ host ++ ":" ++ show port - let settings = Warp.setLogger noLog - $ Warp.setHost (fromString host) - $ Warp.setPort port Warp.defaultSettings - waiApp = Static.staticApp (Static.defaultWebAppSettings directory) - Warp.runSettings settings waiApp + Warp.runSettings warpSettings $ + Static.staticApp (Static.defaultFileServerSettings directory) + where + warpSettings = Warp.setLogger noLog + $ Warp.setHost (fromString host) + $ Warp.setPort port Warp.defaultSettings noLog :: Wai.Request -> Status -> Maybe Integer -> IO () noLog _ _ _ = return () -- cgit v1.2.3