Safe Haskell | None |
---|
This module simply re-exports from other modules for your convenience.
- module Yesod.Core
- module Yesod.Form
- module Yesod.Json
- module Yesod.Persist
- warp :: (Yesod a, YesodDispatch a a) => Int -> a -> IO ()
- warpDebug :: (Yesod a, YesodDispatch a a) => Int -> a -> IO ()
- warpEnv :: (Yesod a, YesodDispatch a a) => a -> IO ()
- develServer :: Int -> String -> String -> IO ()
- type Application = Request -> ResourceT IO Response
- liftIO :: MonadIO m => forall a. IO a -> m a
- class MonadBase b m => MonadBaseControl b m | m -> b
- showIntegral :: Integral a => a -> String
- readIntegral :: Num a => String -> Maybe a
- hamlet :: QuasiQuoter
- xhamlet :: QuasiQuoter
- type HtmlUrl url = Render url -> Html
- type Html = Markup
- toHtml :: ToMarkup a => a -> Html
- julius :: QuasiQuoter
- type JavascriptUrl url = (url -> [(Text, Text)] -> Text) -> Javascript
- renderJavascriptUrl :: (url -> [(Text, Text)] -> Text) -> JavascriptUrl url -> Text
- cassius :: QuasiQuoter
- lucius :: QuasiQuoter
- type CssUrl url = (url -> [(Text, Text)] -> Text) -> Css
- renderCssUrl :: (url -> [(Text, Text)] -> Text) -> CssUrl url -> Text
Re-exports from yesod-core
module Yesod.Core
module Yesod.Form
module Yesod.Json
module Yesod.Persist
Running your application
warp :: (Yesod a, YesodDispatch a a) => Int -> a -> IO ()Source
A convenience method to run an application using the Warp webserver on the
specified port. Automatically calls toWaiApp
.
warpDebug :: (Yesod a, YesodDispatch a a) => Int -> a -> IO ()Source
Same as warp
, but also sends a message to stdout for each request, and
an "application launched" message as well. Can be useful for development.
warpEnv :: (Yesod a, YesodDispatch a a) => a -> IO ()Source
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.
:: Int | port number |
-> String | module name holding the code |
-> String | name of function providing a with-application |
-> IO () |
Run a development server, where your code changes are automatically reloaded.
Commonly referenced functions/datatypes
type Application = Request -> ResourceT IO Response
class MonadBase b m => MonadBaseControl b m | m -> b
Utilities
showIntegral :: Integral a => a -> StringSource
readIntegral :: Num a => String -> Maybe aSource
Hamlet library
Hamlet
Julius
type JavascriptUrl url = (url -> [(Text, Text)] -> Text) -> Javascript
Return type of template-reading functions.
renderJavascriptUrl :: (url -> [(Text, Text)] -> Text) -> JavascriptUrl url -> Text
render with route interpolation. If using this module standalone, apart from type-safe routes, a dummy renderer can be used:
renderJavascriptUrl (\_ _ -> undefined) javascriptUrl
When using Yesod, a renderer is generated for you, which can be accessed
within the GHandler monad: getUrlRenderParams
.
Cassius/Lucius
>>>
renderCss ([lucius|foo{bar:baz}|] undefined)
"foo{bar:baz}"