add rack middleware

It can be used in mounted Rack apps like Grape