packages feed

webby 0.2.0 → 0.3.0

raw patch · 4 files changed

+12/−9 lines, 4 files

Files

src/Webby.hs view
@@ -3,6 +3,7 @@    -- * Routing and handler functions   , RoutePattern+  , Route   , mkRoute   , post   , get
src/Webby/Server.hs view
@@ -182,11 +182,11 @@ invalidRoutesErr :: [Char] invalidRoutesErr = "Invalid route specification: contains duplicate routes or routes with overlapping capture patterns." --- | Use this function, to create a WAI application. It takes a--- user/application defined `appEnv` data type and a list of--- routes. If none of the requests match a request, a default 404--- response is returned.-mkWebbyApp :: appEnv -> [(RoutePattern, WebbyM appEnv ())] -> IO Application+-- | Use this function, to create a WAI application. It takes a user/application+-- defined `appEnv` data type and a list of routes. Routes are matched in the+-- given order. If none of the requests match a request, a default 404 response+-- is returned.+mkWebbyApp :: appEnv -> [Route appEnv] -> IO Application mkWebbyApp appEnv routes' = do     lset <- FLog.newStdoutLoggerSet FLog.defaultBufSize     return $ mkApp lset routes'
src/Webby/Types.hs view
@@ -62,10 +62,12 @@ runWebbyM :: WEnv w -> WebbyM w a -> IO a runWebbyM env = runResourceT . flip runReaderT env . unWebbyM --- A route pattern specifies a HTTP method and a list of path segments--- that must match.+-- | A route pattern represents logic to match a request to a handler. data RoutePattern = RoutePattern Method [Text]                   deriving (Eq, Show)++-- | A route is a pair of a route pattern and a handler.+type Route env = (RoutePattern, WebbyM env ())  -- | Captures are simply extracted path elements in a HashMap type Captures = H.HashMap Text Text
webby.cabal view
@@ -4,10 +4,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: 8328c4d0d2c281b35a9d68f0bf6dd439945809c585fed2b86789a8f70cd00ffd+-- hash: 453573afb20aa05fec6830a6c56f09a3e0ce3770df20ecc25fecb5f278073e09  name:           webby-version:        0.2.0+version:        0.3.0 synopsis:       A super-simple web server framework description:    A super-simple, easy to use web server framework inspired by                 Scotty. The goals of the project are: (1) Be easy to use (2) Allow