add express middleware, close #3