Merge pull request #1318 from s9gf4ult/master

Exports some internals and fix version bounds
This commit is contained in:
Michael Snoyman 2016-12-07 08:50:52 -05:00 committed by GitHub
commit f54b924137
2 changed files with 14 additions and 2 deletions

View File

@ -17,6 +17,8 @@ module Yesod.Core.Dispatch
, mkYesodSubData , mkYesodSubData
, mkYesodDispatch , mkYesodDispatch
, mkYesodSubDispatch , mkYesodSubDispatch
-- *** Helpers
, getGetMaxExpires
-- ** Path pieces -- ** Path pieces
, PathPiece (..) , PathPiece (..)
, PathMultiPiece (..) , PathMultiPiece (..)
@ -24,6 +26,7 @@ module Yesod.Core.Dispatch
-- * Convert to WAI -- * Convert to WAI
, toWaiApp , toWaiApp
, toWaiAppPlain , toWaiAppPlain
, toWaiAppYre
, warp , warp
, warpDebug , warpDebug
, warpEnv , warpEnv
@ -93,6 +96,11 @@ toWaiAppPlain site = do
, yreGetMaxExpires = getMaxExpires , yreGetMaxExpires = getMaxExpires
} }
-- | Pure low level function to construct WAI application. Usefull
-- when you need not standard way to run your app, or want to embed it
-- inside another app.
--
-- @since 1.4.29
toWaiAppYre :: YesodDispatch site => YesodRunnerEnv site -> W.Application toWaiAppYre :: YesodDispatch site => YesodRunnerEnv site -> W.Application
toWaiAppYre yre req = toWaiAppYre yre req =
case cleanPath site $ W.pathInfo req of case cleanPath site $ W.pathInfo req of
@ -237,6 +245,10 @@ warpEnv site = do
Nothing -> error $ "warpEnv: invalid PORT environment variable: " ++ show portS Nothing -> error $ "warpEnv: invalid PORT environment variable: " ++ show portS
Just port -> warp port site Just port -> warp port site
-- | Default constructor for 'yreGetMaxExpires' field. Low level
-- function for simple manual construction of 'YesodRunnerEnv'.
--
-- @since 1.4.29
getGetMaxExpires :: IO (IO Text) getGetMaxExpires :: IO (IO Text)
getGetMaxExpires = mkAutoUpdate defaultUpdateSettings getGetMaxExpires = mkAutoUpdate defaultUpdateSettings
{ updateAction = getCurrentMaxExpiresRFC1123 { updateAction = getCurrentMaxExpiresRFC1123

View File

@ -1,5 +1,5 @@
name: yesod-core name: yesod-core
version: 1.4.28 version: 1.4.29
license: MIT license: MIT
license-file: LICENSE license-file: LICENSE
author: Michael Snoyman <michael@snoyman.com> author: Michael Snoyman <michael@snoyman.com>
@ -56,7 +56,7 @@ library
, resourcet >= 0.4.9 && < 1.2 , resourcet >= 0.4.9 && < 1.2
, lifted-base >= 0.1.2 , lifted-base >= 0.1.2
, blaze-html >= 0.5 , blaze-html >= 0.5
, blaze-markup >= 0.5.1 , blaze-markup >= 0.7.1
, data-default , data-default
, safe , safe
, warp >= 3.0.2 , warp >= 3.0.2