This repository has been archived by the owner on Apr 6, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
snap-web-routes.cabal
77 lines (70 loc) · 2.61 KB
/
snap-web-routes.cabal
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
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: [email protected]
category: Web, Snap
build-type: Simple
cabal-version: >=1.10
extra-source-files:
LICENSE,
README.md
TODO.md
changelog
library
hs-source-dirs: src
default-language: Haskell2010
ghc-options: -O2 -Wall
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 && < 1.20,
mtl >= 2 && < 3,
snap-core >= 0.9 && < 1.1,
snap >= 0.13 && < 1.1,
text >= 0.11 && < 1.3,
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