Move preview server, update to snap 0.4
This commit is contained in:
parent
1075096df7
commit
d66155968f
2 changed files with 4 additions and 4 deletions
|
@ -12,7 +12,7 @@ import System.Directory (doesDirectoryExist, removeDirectoryRecursive)
|
||||||
import Hakyll.Core.Configuration
|
import Hakyll.Core.Configuration
|
||||||
import Hakyll.Core.Run
|
import Hakyll.Core.Run
|
||||||
import Hakyll.Core.Rules
|
import Hakyll.Core.Rules
|
||||||
import Hakyll.Network.Server
|
import Hakyll.Web.Preview.Server
|
||||||
|
|
||||||
-- | This usualy is the function with which the user runs the hakyll compiler
|
-- | This usualy is the function with which the user runs the hakyll compiler
|
||||||
--
|
--
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
-- | Implements a basic static file server for previewing options
|
-- | Implements a basic static file server for previewing options
|
||||||
--
|
--
|
||||||
{-# LANGUAGE OverloadedStrings #-}
|
{-# LANGUAGE OverloadedStrings #-}
|
||||||
module Hakyll.Network.Server
|
module Hakyll.Web.Preview.Server
|
||||||
( staticServer
|
( staticServer
|
||||||
) where
|
) where
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ import System.FilePath ((</>))
|
||||||
import System.Directory (doesFileExist)
|
import System.Directory (doesFileExist)
|
||||||
|
|
||||||
import qualified Data.ByteString as SB
|
import qualified Data.ByteString as SB
|
||||||
import Snap.Util.FileServe (fileServeSingle)
|
import Snap.Util.FileServe (serveFile)
|
||||||
import Snap.Types (Snap, rqURI, getRequest, writeBS)
|
import Snap.Types (Snap, rqURI, getRequest, writeBS)
|
||||||
import Snap.Http.Server ( httpServe, setAccessLog, setErrorLog, addListen
|
import Snap.Http.Server ( httpServe, setAccessLog, setErrorLog, addListen
|
||||||
, ConfigListen (..), emptyConfig
|
, ConfigListen (..), emptyConfig
|
||||||
|
@ -54,7 +54,7 @@ static directory preServe = do
|
||||||
-- Found, serve
|
-- Found, serve
|
||||||
Just f -> do
|
Just f -> do
|
||||||
liftIO $ preServe f
|
liftIO $ preServe f
|
||||||
fileServeSingle f
|
serveFile f
|
||||||
|
|
||||||
-- | Main method, runs a static server in the given directory
|
-- | Main method, runs a static server in the given directory
|
||||||
--
|
--
|
Loading…
Reference in a new issue