aboutsummaryrefslogtreecommitdiff
path: root/lazybones.lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lazybones.lisp')
-rw-r--r--lazybones.lisp6
1 files changed, 4 insertions, 2 deletions
diff --git a/lazybones.lisp b/lazybones.lisp
index b1ffd0e..e7d1e94 100644
--- a/lazybones.lisp
+++ b/lazybones.lisp
@@ -152,7 +152,8 @@ E.g.: /foo/bar/:goo/zar/:moo would result in (GOO MOO)"
(loop :for val :in (split-sequence:split-sequence #\/ path-spec)
:when (path-var-p val) :collect (read-from-string (subseq val 1))))
-(defmacro with-handler-preamble (preamble &body route-defs)
+
+(defmacro with-handler-preamble ((&rest preamble) &body route-defs)
"Inserts PREAMBLE form into the beginning of each ROUTE-DEF, which
must be a valid DEFROUTE form.
@@ -166,9 +167,10 @@ setting up variables, etc.
:collect (list* 'lazybones:defroute
method
path
- (cons preamble handler-forms)))))
+ (append preamble handler-forms)))))
`(progn ,@transformed)))
+
(defmacro defroute (method path &rest body)
"Defines a new route handler.