Add middleware to docs