comply with hy's tao rules for getattr
This commit is contained in:
parent
3f1243f88c
commit
ff7c71b9c9
@ -3,13 +3,13 @@
|
|||||||
|
|
||||||
(defmacro route [name path params code]
|
(defmacro route [name path params code]
|
||||||
"Default get request"
|
"Default get request"
|
||||||
`(let [[deco ((getattr app "route") ~path)]]
|
`(let [[deco (.route app ~path)]]
|
||||||
(with-decorator deco
|
(with-decorator deco
|
||||||
(defn ~name ~params ~@code))))
|
(defn ~name ~params ~@code))))
|
||||||
|
|
||||||
(defmacro route-with-methods [name path params code methods]
|
(defmacro route-with-methods [name path params code methods]
|
||||||
"Same as route but with an extra methods array to specify HTTP methods"
|
"Same as route but with an extra methods array to specify HTTP methods"
|
||||||
`(let [[deco (kwapply ((getattr app "route") ~path)
|
`(let [[deco (kwapply (.route app ~path)
|
||||||
{"methods" ~methods})]]
|
{"methods" ~methods})]]
|
||||||
(with-decorator deco
|
(with-decorator deco
|
||||||
(defn ~name ~params ~@code))))
|
(defn ~name ~params ~@code))))
|
||||||
|
Loading…
Reference in New Issue
Block a user