diff --git a/lib/apiswagger.js b/lib/apiswagger.js index 794b99b..7d391f0 100644 --- a/lib/apiswagger.js +++ b/lib/apiswagger.js @@ -513,8 +513,7 @@ module.exports = (app, client) => { match_all: {} } }, { asStream: true }) - chain([ - result, + result.pipe(chain([ parser(), data => data.value.hits.hits, streamArray(), @@ -527,7 +526,7 @@ module.exports = (app, client) => { }), stringer(), zlib.createGzip() - ]).pipe(res, { end: true }) + ])).pipe(res, { end: true }) } catch (e) { console.error(e) res.status(404).end()