Permalink
Browse files

appended README about Middleware.

  • Loading branch information...
1 parent c275823 commit b678d00d4cdb7055eb19c267f8b08a4a4fb48d97 @fukamachi committed Jan 15, 2011
Showing with 21 additions and 3 deletions.
  1. +21 −3 README.markdown
View
@@ -23,7 +23,27 @@ Now access [http://localhost:8080/](http://localhost:8080/) and Clack show you "
## Middleware
-Write.
+### Use Middleware
+
+* clack.middleware.static
+
+ (defpackage simple-app
+ (:use :cl :clack :clack.middleware.static))
+
+ (in-package :simple-app)
+
+ (defvar app
+ (lambda (req)
+ '(200 (:content-type "text/plain") ("Hello, Clack!"))))
+
+ (run
+ (builder
+ (<clack-middleware-static>
+ :urls '(#p"favicon.ico" #p"404.html")
+ :root #p"/public/")
+ app))
+
+### How to write Middleware?
(defpackage clack.middleware.example
(:use :cl :clack)
@@ -37,8 +57,6 @@ Write.
,(cons "Hello, Clack Middleware!<br />"
(nth 2 (call (app self) req)))))
-Use.
-
(defpackage simple-app
(:use :cl :clack :clack.middleware.example))

0 comments on commit b678d00

Please sign in to comment.