Skip to content

Commit

Permalink
Merge pull request #1318 from s9gf4ult/master
Browse files Browse the repository at this point in the history
Exports some internals and fix version bounds
  • Loading branch information
snoyberg committed Dec 7, 2016
2 parents 9c38a4b + 80f0b3c commit f54b924
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
12 changes: 12 additions & 0 deletions yesod-core/Yesod/Core/Dispatch.hs
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,16 @@ module Yesod.Core.Dispatch
, mkYesodSubData
, mkYesodDispatch
, mkYesodSubDispatch
-- *** Helpers
, getGetMaxExpires
-- ** Path pieces
, PathPiece (..)
, PathMultiPiece (..)
, Texts
-- * Convert to WAI
, toWaiApp
, toWaiAppPlain
, toWaiAppYre
, warp
, warpDebug
, warpEnv
Expand Down Expand Up @@ -93,6 +96,11 @@ toWaiAppPlain site = do
, 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 yre req =
case cleanPath site $ W.pathInfo req of
Expand Down Expand Up @@ -237,6 +245,10 @@ warpEnv site = do
Nothing -> error $ "warpEnv: invalid PORT environment variable: " ++ show portS
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 = mkAutoUpdate defaultUpdateSettings
{ updateAction = getCurrentMaxExpiresRFC1123
Expand Down
4 changes: 2 additions & 2 deletions yesod-core/yesod-core.cabal
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: yesod-core
version: 1.4.28
version: 1.4.29
license: MIT
license-file: LICENSE
author: Michael Snoyman <michael@snoyman.com>
Expand Down Expand Up @@ -56,7 +56,7 @@ library
, resourcet >= 0.4.9 && < 1.2
, lifted-base >= 0.1.2
, blaze-html >= 0.5
, blaze-markup >= 0.5.1
, blaze-markup >= 0.7.1
, data-default
, safe
, warp >= 3.0.2
Expand Down

0 comments on commit f54b924

Please sign in to comment.