Express middleware which resolves promises