snap-web-routes-0.5.0.0: snap-web-routes.cabal
name: snap-web-routes
version: 0.5.0.0
synopsis: Type safe URLs for Snap
description:
Type safe URL generation and routing for Snap using <http://hackage.haskell.org/package/web-routes web-routes>, and builds on <https://github.com/stepcut/snap-web-routes-demo work>
done by Jeremy Shaw.
.
Get started with the comprehensive __<https://github.com/lukerandall/snap-web-routes/blob/master/README.md tutorial>__.
.
= Brief overview
.
It allows you to define a data type that represents the routes in your application:
.
> data AppUrl
> = Login -- routes to /login
> | Logout -- routes to /logout
> | User (Resource UserId) -- provides RESTful routes at /user
.
'Resource' is documented in Snap.Snaplet.Router.REST, and makes defining RESTful routes easier. Also provided are functions to use the URL data type in your app:
.
> someHandler :: Handler App App ()
> someHandler :: doSomething >> redirectURL $ User Index
.
and to generate URLs in views:
.
> linksHandler :: Handler App App ()
> linksHandler = heistLocal (I.bindSplices linksSplices) $ render "links"
> where
> linksSplices = do
> "loginUrl" ## urlSplice Login
.
homepage: https://github.com/lukerandall/snap-web-routes
bug-reports: https://github.com/lukerandall/snap-web-routes/issues
license: BSD3
license-file: LICENSE
author: Luke Randall
maintainer: luke.randall@gmail.com
category: Web, Snap
build-type: Simple
cabal-version: >=1.10
extra-source-files:
LICENSE,
README.md
TODO.md
changelog
library
hs-source-dirs: src
exposed-modules:
Snap.Snaplet.Router
Snap.Snaplet.Router.HeistSplices
Snap.Snaplet.Router.Internal.Types
Snap.Snaplet.Router.REST
Snap.Snaplet.Router.Types
Snap.Snaplet.Router.URL
build-depends:
base >= 4.4 && < 5,
bytestring >= 0.9.1 && < 0.11,
heist >= 0.13 && < 0.14,
mtl >= 2 && < 3,
snap-core >= 0.9 && < 0.11,
snap >= 0.13 && < 0.14,
text >= 0.11 && < 1.2,
web-routes >= 0.27 && < 0.28,
xmlhtml >= 0.1
default-language: Haskell2010
source-repository head
type: git
location: https://github.com/lukerandall/snap-web-routes.git