summaryrefslogtreecommitdiff
path: root/src/Hakyll/Web/Preview
diff options
context:
space:
mode:
authorJasper Van der Jeugt <m@jaspervdj.be>2011-12-03 12:57:20 +0100
committerJasper Van der Jeugt <m@jaspervdj.be>2011-12-03 12:57:20 +0100
commit7951869a07526746cd03f9fa03ed11ce360caa08 (patch)
tree99a505f160ac4e9a5a7965c93ff484574f773cd5 /src/Hakyll/Web/Preview
parent9ba8e1b07b44ca4a3c2e6e60f6d03de1d3ee1cc6 (diff)
downloadhakyll-7951869a07526746cd03f9fa03ed11ce360caa08.tar.gz
Bump Snap dependency
Fixes #46
Diffstat (limited to 'src/Hakyll/Web/Preview')
-rw-r--r--src/Hakyll/Web/Preview/Server.hs30
1 files changed, 13 insertions, 17 deletions
diff --git a/src/Hakyll/Web/Preview/Server.hs b/src/Hakyll/Web/Preview/Server.hs
index 22d48ad..15a1a33 100644
--- a/src/Hakyll/Web/Preview/Server.hs
+++ b/src/Hakyll/Web/Preview/Server.hs
@@ -7,25 +7,21 @@ module Hakyll.Web.Preview.Server
import Control.Monad.Trans (liftIO)
-import Snap.Types (Snap)
-import Snap.Util.FileServe ( DirectoryConfig (..), fancyDirectoryConfig
- , serveDirectoryWith
- )
-import Snap.Http.Server ( httpServe, setAccessLog, setErrorLog
- , setPort, emptyConfig
- )
+import qualified Snap.Core as Snap
+import qualified Snap.Http.Server as Snap
+import qualified Snap.Util.FileServe as Snap
-- | Serve a given directory
--
static :: FilePath -- ^ Directory to serve
-> (FilePath -> IO ()) -- ^ Pre-serve hook
- -> Snap ()
+ -> Snap.Snap ()
static directory preServe =
- serveDirectoryWith directoryConfig directory
+ Snap.serveDirectoryWith directoryConfig directory
where
- directoryConfig :: DirectoryConfig Snap
- directoryConfig = fancyDirectoryConfig
- { preServeHook = liftIO . preServe
+ directoryConfig :: Snap.DirectoryConfig Snap.Snap
+ directoryConfig = Snap.fancyDirectoryConfig
+ { Snap.preServeHook = liftIO . preServe
}
-- | Main method, runs a static server in the given directory
@@ -35,10 +31,10 @@ staticServer :: FilePath -- ^ Directory to serve
-> Int -- ^ Port to listen on
-> IO () -- ^ Blocks forever
staticServer directory preServe port =
- httpServe config $ static directory preServe
+ Snap.httpServe config $ static directory preServe
where
-- Snap server config
- config = setPort port
- $ setAccessLog Nothing
- $ setErrorLog Nothing
- $ emptyConfig
+ config = Snap.setPort port
+ $ Snap.setAccessLog Snap.ConfigNoLog
+ $ Snap.setErrorLog Snap.ConfigNoLog
+ $ Snap.emptyConfig