ticket:3 Create middleware
Merge branch 't3_middleware'