Middleware function support
Merge pull request #12 from sposmen/master

Middleware function support