added basic function of middleware
Merge pull request #45 from fireweb/master

added basic function of middleware 
#41