on master help sign in
Bump Snap dependency

Fixes #46

commit7951869a07526746cd03f9fa03ed11ce360caa08 authorJasper Van der Jeugt <m@jaspervdj.be> dateSat 3 Dec 2011, 12:57 (15 years ago) parent9ba8e1b
2 files changed+15−19
hakyll.cabal+2−2 src/Hakyll/Web/Preview/Server.hs+13−17
hakyll.cabal+2−2
@@ -136,8 +136,8 @@ Library
136136
137137 If flag(previewServer)
138138 Build-depends:
139− snap-core >= 0.5.1 && < 0.6,
140− snap-server >= 0.5.1 && < 0.6
139+ snap-core >= 0.6 && < 0.8,
140+ snap-server >= 0.6 && < 0.8
141141 Cpp-Options:
142142 -DPREVIEW_SERVER
143143 Other-Modules:
src/Hakyll/Web/Preview/Server.hs+13−17
@@ -7,25 +7,21 @@ module Hakyll.Web.Preview.Server
77
88import Control.Monad.Trans (liftIO)
99
10−import Snap.Types (Snap)
11−import Snap.Util.FileServe ( DirectoryConfig (..), fancyDirectoryConfig
12− , serveDirectoryWith
13− )
14−import Snap.Http.Server ( httpServe, setAccessLog, setErrorLog
15− , setPort, emptyConfig
16− )
10+import qualified Snap.Core as Snap
11+import qualified Snap.Http.Server as Snap
12+import qualified Snap.Util.FileServe as Snap
1713
1814-- | Serve a given directory
1915--
2016static :: FilePath -- ^ Directory to serve
2117 -> (FilePath -> IO ()) -- ^ Pre-serve hook
22− -> Snap ()
18+ -> Snap.Snap ()
2319static directory preServe =
24− serveDirectoryWith directoryConfig directory
20+ Snap.serveDirectoryWith directoryConfig directory
2521 where
26− directoryConfig :: DirectoryConfig Snap
27− directoryConfig = fancyDirectoryConfig
28− { preServeHook = liftIO . preServe
22+ directoryConfig :: Snap.DirectoryConfig Snap.Snap
23+ directoryConfig = Snap.fancyDirectoryConfig
24+ { Snap.preServeHook = liftIO . preServe
2925 }
3026
3127-- | Main method, runs a static server in the given directory
@@ -35,10 +31,10 @@ staticServer :: FilePath -- ^ Directory to serve
3531 -> Int -- ^ Port to listen on
3632 -> IO () -- ^ Blocks forever
3733staticServer directory preServe port =
38− httpServe config $ static directory preServe
34+ Snap.httpServe config $ static directory preServe
3935 where
4036 -- Snap server config
41− config = setPort port
42− $ setAccessLog Nothing
43− $ setErrorLog Nothing
44− $ emptyConfig
37+ config = Snap.setPort port
38+ $ Snap.setAccessLog Snap.ConfigNoLog
39+ $ Snap.setErrorLog Snap.ConfigNoLog
40+ $ Snap.emptyConfig