warpEnv
This commit is contained in:
parent
48357a6fd3
commit
8793cffe47
@ -1,5 +1,5 @@
|
||||
name: yesod-form
|
||||
version: 1.1.2
|
||||
version: 1.1.3
|
||||
license: MIT
|
||||
license-file: LICENSE
|
||||
author: Michael Snoyman <michael@snoyman.com>
|
||||
|
||||
@ -10,6 +10,7 @@ module Yesod
|
||||
-- * Running your application
|
||||
, warp
|
||||
, warpDebug
|
||||
, warpEnv
|
||||
, develServer
|
||||
-- * Commonly referenced functions/datatypes
|
||||
, Application
|
||||
@ -58,6 +59,8 @@ import Text.Blaze.Html (toHtml)
|
||||
import Text.Blaze (toHtml)
|
||||
#endif
|
||||
|
||||
import System.Environment (getEnv)
|
||||
|
||||
showIntegral :: Integral a => a -> String
|
||||
showIntegral x = show (fromIntegral x :: Integer)
|
||||
|
||||
@ -80,6 +83,19 @@ warpDebug port app = do
|
||||
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.
|
||||
develServer :: Int -- ^ port number
|
||||
|
||||
@ -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>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user