bind the endpoint to the middleware

- this allows checking this.auth
Merge pull request #1 from dweinstein/middleware-bind

bind the endpoint to the middleware