on master help sign in
Move preview server, update to snap 0.4
d661559Jasper Van der Jeugt
src/Hakyll/Main.hs+1−1
@@ -12,7 +12,7 @@ import System.Directory (doesDirectoryExist, removeDirectoryRecursive)
12import Hakyll.Core.Configuration
12import Hakyll.Core.Configuration
13import Hakyll.Core.Run
13import Hakyll.Core.Run
14import Hakyll.Core.Rules
14import Hakyll.Core.Rules
15−import Hakyll.Network.Server
15+import Hakyll.Web.Preview.Server
16
16
17-- | This usualy is the function with which the user runs the hakyll compiler
17-- | This usualy is the function with which the user runs the hakyll compiler
18--
18--
src/Hakyll/Network/Server.hs → src/Hakyll/Web/Preview/Server.hsrenamed+3−3
@@ -1,7 +1,7 @@
1-- | Implements a basic static file server for previewing options
1-- | Implements a basic static file server for previewing options
2--
2--
3{-# LANGUAGE OverloadedStrings #-}
3{-# LANGUAGE OverloadedStrings #-}
4−module Hakyll.Network.Server
4+module Hakyll.Web.Preview.Server
5 ( staticServer
5 ( staticServer
6 ) where
6 ) where
7
7
@@ -12,7 +12,7 @@ import System.FilePath ((</>))
12import System.Directory (doesFileExist)
12import System.Directory (doesFileExist)
13
13
14import qualified Data.ByteString as SB
14import qualified Data.ByteString as SB
15−import Snap.Util.FileServe (fileServeSingle)
15+import Snap.Util.FileServe (serveFile)
16import Snap.Types (Snap, rqURI, getRequest, writeBS)
16import Snap.Types (Snap, rqURI, getRequest, writeBS)
17import Snap.Http.Server ( httpServe, setAccessLog, setErrorLog, addListen
17import Snap.Http.Server ( httpServe, setAccessLog, setErrorLog, addListen
18 , ConfigListen (..), emptyConfig
18 , ConfigListen (..), emptyConfig
@@ -54,7 +54,7 @@ static directory preServe = do
54 -- Found, serve
54 -- Found, serve
55 Just f -> do
55 Just f -> do
56 liftIO $ preServe f
56 liftIO $ preServe f
57− fileServeSingle f
57+ serveFile f
58
58
59-- | Main method, runs a static server in the given directory
59-- | Main method, runs a static server in the given directory
60--
60--