Switch to EMBED_REFRESH
This commit is contained in:
parent
b81a9721fb
commit
6b2e4ef3a4
@ -1,9 +1,7 @@
|
|||||||
{-# LANGUAGE CPP #-}
|
{-# LANGUAGE CPP #-}
|
||||||
{-# LANGUAGE OverloadedStrings #-}
|
{-# LANGUAGE OverloadedStrings #-}
|
||||||
{-# LANGUAGE ScopedTypeVariables #-}
|
{-# LANGUAGE ScopedTypeVariables #-}
|
||||||
#ifdef EMBED_REFRESH
|
|
||||||
{-# LANGUAGE TemplateHaskell #-}
|
{-# LANGUAGE TemplateHaskell #-}
|
||||||
#endif
|
|
||||||
module Devel
|
module Devel
|
||||||
( devel
|
( devel
|
||||||
, DevelOpts(..)
|
, DevelOpts(..)
|
||||||
@ -79,11 +77,7 @@ import Network.Socket (sClose)
|
|||||||
import Network.Wai (responseLBS)
|
import Network.Wai (responseLBS)
|
||||||
import Network.Wai.Handler.Warp (run)
|
import Network.Wai.Handler.Warp (run)
|
||||||
import SrcLoc (Located)
|
import SrcLoc (Located)
|
||||||
#ifdef EMBED_REFRESH
|
|
||||||
import Data.FileEmbed (embedFile)
|
import Data.FileEmbed (embedFile)
|
||||||
#else
|
|
||||||
import Paths_yesod_bin
|
|
||||||
#endif
|
|
||||||
|
|
||||||
lockFile :: DevelOpts -> FilePath
|
lockFile :: DevelOpts -> FilePath
|
||||||
lockFile _opts = "yesod-devel/devel-terminate"
|
lockFile _opts = "yesod-devel/devel-terminate"
|
||||||
@ -128,11 +122,7 @@ cabalProgram opts | isCabalDev opts = "cabal-dev"
|
|||||||
reverseProxy :: DevelOpts -> I.IORef Int -> IO ()
|
reverseProxy :: DevelOpts -> I.IORef Int -> IO ()
|
||||||
reverseProxy opts iappPort = do
|
reverseProxy opts iappPort = do
|
||||||
manager <- newManager def
|
manager <- newManager def
|
||||||
#ifdef EMBED_REFRESH
|
|
||||||
let refreshHtml = LB.fromStrict $(embedFile "refreshing.html")
|
let refreshHtml = LB.fromStrict $(embedFile "refreshing.html")
|
||||||
#else
|
|
||||||
refreshHtml <- liftIO $ getDataFileName "refreshing.html" >>= LB.readFile
|
|
||||||
#endif
|
|
||||||
let onExc _ _ = return $ responseLBS status200
|
let onExc _ _ = return $ responseLBS status200
|
||||||
[ ("content-type", "text/html")
|
[ ("content-type", "text/html")
|
||||||
, ("Refresh", "1")
|
, ("Refresh", "1")
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user