Clack.Middleware - Base Class for Clack Middleware.

SYNOPSIS

(in-package :cl-user)  
(defpackage clack.middleware.example  
  (:use :cl :clack)  
  (:export :<clack-middleware-example>))  
(in-package :clack.middleware.example)  
 
(defclass <clack-middleware-example> (<middleware>) ())  
(defmethod call ((this <clack-middleware-example>) env)  
  ;; pre-processing `env`  
  (let ((res (call-next this env)))  
    ;; post-processing `res`  
    res)) 

DESCRIPTION

Clack.Middleware is the base class to write Clack Middleware.

All you have to do is to inherit from <middleware> and then implement the callback call method to do the actual work.

Middleware is similar to ':around' method of CLOS. You can delegate some processes to Application (or next Middleware) to call call-next.

AUTHOR

Author: Eitarow Fukamachi (e.arrows@gmail.com)

SEE ALSO

EXTERNAL SYMBOLS