packages feed

yesod-bin 1.2.1 → 1.2.2

raw patch · 3 files changed

+81/−4 lines, 3 files

Files

Devel.hs view
@@ -7,6 +7,7 @@     , defaultDevelOpts     ) where +import           Paths_yesod_bin  import qualified Distribution.Compiler                 as D import qualified Distribution.ModuleName               as D@@ -28,6 +29,7 @@ import           Control.Monad.Trans.State             (evalStateT, get) import qualified Data.IORef                            as I +import qualified Data.ByteString.Lazy                  as LB import           Data.Char                             (isNumber, isUpper) import qualified Data.List                             as L import qualified Data.Map                              as Map@@ -144,12 +146,15 @@             putStrLn "Restarting reverse proxy"     loop `Ex.onException` exitFailure   where-    onExc _ _ = return $ responseLBS+    onExc _ _ = do+      refreshing <- liftIO $ getDataFileName "refreshing.html"+      html <- liftIO $ LB.readFile refreshing+      return $ responseLBS         status200         [ ("content-type", "text/html")         , ("Refresh", "1")         ]-        "<h1>App not ready, please refresh</h1>"+        html  checkPort :: Int -> IO Bool checkPort p = do@@ -444,4 +449,3 @@ -- | wait for process started by @createProcess@, return True for ExitSuccess checkExit :: (Maybe Handle, Maybe Handle, Maybe Handle, ProcessHandle) -> IO Bool checkExit (_,_,_,h) = (==ExitSuccess) <$> waitForProcess' h-
+ refreshing.html view
@@ -0,0 +1,72 @@+<!doctype html>+<html>+  <head>+    <meta charset='utf-8'>+    <title>Refreshing - Yesod devel</title>+    <style>+      body {+      background: #e6e6e6;+      color: #444;+      text-shadow: 1px 1px 1px #ffffff;+      font-size: 30px;+      font-family: georgia, serif;+      }+      .wrap {+      margin: auto;+      width: 25em;+      }+      h1 {+      margin-bottom: 0;+      }+      h2 {+      margin-top: 0;+      font-size: 1em;+      font-style: italic;+      color: #546369;+      }+      header {+      margin-top: 1em;+      padding-bottom: 0.25em;+      border-bottom: 1px solid #ccc;+      color: #1a6e8e;+      }+      footer {+      margin-top: 3em;+      padding-top: 0.25em;+      border-top: 1px solid #ccc;+      color: #666;+      font-size: 0.8em;+      }+      .msgs {+      font-size: 0.9em;+      }+      .msgs p {+      margin-bottom: 0.5em;+      }+      .msgs ul {+      margin-top: 0;+      line-height: 1.7em;+      }+      .msgs li {+      padding-left: 0.5em;+      }+    </style>+  </head>+  <body>+    <div class="wrap">+      <header><small>Yesod Devel</small></header>+      <h1>The application isn’t built</h1>+      <h2>We’ll keep trying to refresh every second</h2>+      <div class="msgs">+        <p>Meanwhile, here are some motivational messages:</p>+        <ul>+          <li>You are a beautiful person making a beautiful web site.</li>+          <li>Keep going, you’ve nearly fixed the bug!</li>+          <li>Check your posture, don’t lean over too much.</li>+          <li>Get a glass of water, keep hydrated.</li>+        </ul>+      </div>+      <footer><small><script>document.write(new Date())</script></small></footer>+    </div>+  </body>+</html>
yesod-bin.cabal view
@@ -1,5 +1,5 @@ name:            yesod-bin-version:         1.2.1+version:         1.2.2 license:         MIT license-file:    LICENSE author:          Michael Snoyman <michael@snoyman.com>@@ -11,6 +11,7 @@ cabal-version:   >= 1.6 build-type:      Simple homepage:        http://www.yesodweb.com/+data-files:      refreshing.html  extra-source-files:   input/*.cg