;; for Function
@url GET "/login"
(defun login (req)
;; response
)
;; for Clack Component
@url GET "/member/:id"
(defclass <member-profile> (<component>) ())
(defmethod call ((this <member-profile>) req)
;; response
)
Caveman.Route provides an useful annotation `url' to define a Caveman Action.
Useful annotation to define actions. Example: ;; for Function @url GET "/login" (defun login (req) ;; response ) ;; for Clack Component @url GET "/member/:id" (defclass( ) ()) (defmethod call ((this ) req) ;; response )
Convert action form into a routing rule, a list. Example: ((member-profile ##'member-profile) (login-form # #'login-form))
Make an URL for the action with PARAMS. Example: @url GET "/animals/:type" (defun animals (params)) (url-for 'animals :type "cat") ;; => "/animals/cat"