Support for using as express middleware