diff options
author | Jasper Van der Jeugt <m@jaspervdj.be> | 2016-07-31 15:53:50 +0200 |
---|---|---|
committer | Jasper Van der Jeugt <m@jaspervdj.be> | 2016-07-31 15:53:50 +0200 |
commit | 98e0b03fb4be3b1da0ea7f95da6348f3a2370034 (patch) | |
tree | 69364b5f6940dde0a6b276c3aa428de0f7415f03 | |
parent | 02d7520b429359dde5719a232afca7f3b45b938e (diff) | |
download | hakyll-98e0b03fb4be3b1da0ea7f95da6348f3a2370034.tar.gz |
Enable listings and indices in the preview server
Fixes #457
-rw-r--r-- | src/Hakyll/Preview/Server.hs | 11 |
1 files 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 () |