Fix example for using middlewares

Added the missing variables, and fixed the call to the adapter for generating the response
Merge pull request #1 from CHH/patch-1

Fix example for using middlewares