add middleware
Merge pull request #4 from red-s-bean/master

add middleware