- parseRoutes :: QuasiQuoter
- mkYesod :: String -> [Resource] -> Q [Dec]
- mkYesodSub :: String -> Cxt -> [Resource] -> Q [Dec]
- mkYesodData :: String -> [Resource] -> Q [Dec]
- mkYesodDispatch :: String -> [Resource] -> Q [Dec]
- class SinglePiece s where
- fromSinglePiece :: String -> Either String s
- toSinglePiece :: s -> String
- class MultiPiece s where
- fromMultiPiece :: [String] -> Either String s
- toMultiPiece :: s -> [String]
- type Strings = [String]
- toWaiApp :: (Yesod y, YesodSite y) => y -> IO Application
- basicHandler :: (Yesod y, YesodSite y) => Int -> y -> IO ()
- basicHandler' :: (Yesod y, YesodSite y) => Int -> Maybe String -> y -> IO ()
Quasi-quoted routing
A quasi-quoter to parse a string into a list of Resource
s. Checks for
overlapping routes, failing if present; use parseRoutesNoCheck
to skip the
checking. See documentation site for details on syntax.
Generates URL datatype and site function for the given Resource
s. This
is used for creating sites, not subsites. See mkYesodSub
for the latter.
Use parseRoutes
to create the Resource
s.
Generates URL datatype and site function for the given Resource
s. This
is used for creating subsites, not sites. See mkYesod
for the latter.
Use parseRoutes
to create the Resource
s. In general, a subsite is not
executable by itself, but instead provides functionality to
be embedded in other sites.
More fine-grained
mkYesodData :: String -> [Resource] -> Q [Dec]Source
Sometimes, you will want to declare your routes in one file and define
your handlers elsewhere. For example, this is the only way to break up a
monolithic file into smaller parts. Use this function, paired with
mkYesodDispatch
, to do just that.
mkYesodDispatch :: String -> [Resource] -> Q [Dec]Source
See mkYesodData
.
Path pieces
class SinglePiece s where
fromSinglePiece :: String -> Either String s
toSinglePiece :: s -> String
class MultiPiece s where
fromMultiPiece :: [String] -> Either String s
toMultiPiece :: s -> [String]
Convert to WAI
toWaiApp :: (Yesod y, YesodSite y) => y -> IO ApplicationSource
Convert the given argument into a WAI application, executable with any WAI
handler. You can use basicHandler
if you wish.
Runs an application with CGI if CGI variables are present (namely PATH_INFO); otherwise uses SimpleServer.