-
Notifications
You must be signed in to change notification settings - Fork 3
/
BRAINSTORM
38 lines (29 loc) · 964 Bytes
/
BRAINSTORM
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
(defn home
[request]
{:status 200})
(defn authenticate
[inner]
(fn [request]
(if (auth request)
(inner request)
{:status 401})))
(def composite (comp enrich authenticate))
(def auth-routes [["/user" :user-home ...]
["/"]])
(def user-routes ["/user" :user ... []])
(def routes [["/" :home {:GET {:action home}}]
user-routes
admin
api])
(def routes [["/" :home {:GET {:action home}} []]])
--> (def page-tree
(def handler
(let [router (make-router routes {:wrappers [authenticate [:user-home :yellow]
enrich [:user-home]
wrap-json-params [:gonon]
composite [:yellow]]
:hello !!})
[route-for router-2] (make-router other-routes)
(route-for slug params)]
(-> router
())))