-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | A very simple Wai router -- @package waitra @version 0.0.3.0 -- | Network.Waitra.Embedded is a missing part from -- wai-app-static. module Network.Waitra.Embedded -- | Create a [(FilePath, ByteString)] list, recursively -- traversing given directory path. -- --
-- staticApp $ embeddedSettings $(mkRecursiveEmbedded "static") -- -- is an in-memory equivalent of -- staticApp $ defaultFileServerSettings "static" --mkRecursiveEmbedded :: FilePath -> Q Exp -- | Network.Waitra is a very simple router. It's useful for -- writing simple API web-services, when you don't want to use the whole -- Yesod stack. module Network.Waitra -- | We use strings, as - unluckily - Applicative doesn't work with -- Text directly. type Path = String data Route Route :: Method -> (RE Char Application) -> Route simpleRoute :: Method -> Path -> Application -> Route simpleGet :: Path -> Application -> Route simplePost :: Path -> Application -> Route simplePut :: Path -> Application -> Route simpleDelete :: Path -> Application -> Route routeGet :: RE Char Application -> Route routePost :: RE Char Application -> Route routePut :: RE Char Application -> Route routeDelete :: RE Char Application -> Route jsonApp :: (FromJSON a, ToJSON b) => (a -> IO (Status, ResponseHeaders, b)) -> Application jsonApp' :: ToJSON b => IO (Status, ResponseHeaders, b) -> Application routeMiddleware :: Route -> Middleware -- | Turn the list of routes into Middleware waitraMiddleware :: [Route] -> Middleware