packages feed

yesod 1.1.0.3 → 1.1.1

raw patch · 4 files changed

+23/−6 lines, 4 files

Files

Yesod.hs view
@@ -10,6 +10,7 @@       -- * Running your application     , warp     , warpDebug+    , warpEnv     , develServer       -- * Commonly referenced functions/datatypes     , Application@@ -52,11 +53,8 @@ import Network.Wai.Middleware.RequestLogger (logStdout) import Network.Wai.Handler.Warp (run) import System.IO (stderr, hPutStrLn)-#if MIN_VERSION_blaze_html(0, 5, 0) import Text.Blaze.Html (toHtml)-#else-import Text.Blaze (toHtml)-#endif+import System.Environment (getEnv)  showIntegral :: Integral a => a -> String showIntegral x = show (fromIntegral x :: Integer)@@ -79,6 +77,19 @@   hPutStrLn stderr $ "Application launched, listening on port " ++ show port   waiApp <- toWaiApp app   run port $ logStdout waiApp++-- | Runs your application using default middlewares (i.e., via 'toWaiApp'). It+-- reads port information from the PORT environment variable, as used by tools+-- such as Keter.+--+-- Note that the exact behavior of this function may be modified slightly over+-- time to work correctly with external tools, without a change to the type+-- signature.+warpEnv :: (Yesod a, YesodDispatch a a) => a -> IO ()+warpEnv master = do+    port <- getEnv "PORT" >>= readIO+    app <- toWaiApp master+    run port app  -- | Run a development server, where your code changes are automatically -- reloaded.
scaffold/Foundation.hs.cg view
@@ -23,6 +23,7 @@ import Yesod.Default.Util (addStaticContentExternal) import Network.HTTP.Conduit (Manager) import qualified Settings+import Settings.Development (development) import qualified Database.Persist.Store import Settings.StaticFiles import Database.Persist.~importGenericDB~@@ -114,6 +115,11 @@      -- Place Javascript at bottom of the body tag so the rest of the page loads first     jsLoader _ = BottomOfBody++    -- What messages should be logged. The following includes all messages when+    -- in development, and warnings and errors in production.+    shouldLog _ _source level =+        development || level == LevelWarn || level == LevelError  -- How to run database actions. instance YesodPersist ~sitearg~ where
scaffold/project.cabal.cg view
@@ -52,7 +52,7 @@     build-depends: base                          >= 4          && < 5                  -- , yesod-platform                >= 1.1        && < 1.2                  , yesod                         >= 1.1        && < 1.2-                 , yesod-core                    >= 1.1        && < 1.2+                 , yesod-core                    >= 1.1.2      && < 1.2                  , yesod-auth                    >= 1.1        && < 1.2                  , yesod-static                  >= 1.1        && < 1.2                  , yesod-default                 >= 1.1        && < 1.2
yesod.cabal view
@@ -1,5 +1,5 @@ name:            yesod-version:         1.1.0.3+version:         1.1.1 license:         MIT license-file:    LICENSE author:          Michael Snoyman <michael@snoyman.com>