Update example to use the new Middleware mechanism.