This commit is contained in:
parent
df2902613d
commit
755e88ba07
@ -5,7 +5,7 @@ module.exports = (app, client) => {
|
||||
zlib = require('zlib'),
|
||||
{ chain } = require('stream-chain'),
|
||||
{ parser } = require('stream-json'),
|
||||
{ streamValues } = require('stream-json/streamers/StreamValues'),
|
||||
{ stringer } = require('stream-json/jsonl/Stringer'),
|
||||
{ streamArray } = require('stream-json/streamers/StreamArray'),
|
||||
clean = str => {
|
||||
return str.replace(/[\/\\^$+?()`'¡¿¨!"·%&=;,\|\[\]{}]+/gmi, '')
|
||||
@ -516,7 +516,6 @@ module.exports = (app, client) => {
|
||||
chain([
|
||||
result,
|
||||
parser(),
|
||||
streamValues(),
|
||||
data => data.value.hits.hits,
|
||||
streamArray(),
|
||||
data => ({
|
||||
@ -526,9 +525,9 @@ module.exports = (app, client) => {
|
||||
last: data.value._source.last,
|
||||
nodeinfo: data.value._source.nodeinfo
|
||||
}),
|
||||
zlib.createGzip(),
|
||||
res
|
||||
])
|
||||
stringer(),
|
||||
zlib.createGzip()
|
||||
]).pipe(res, { end: true })
|
||||
} catch (e) {
|
||||
console.error(e)
|
||||
res.status(404).end()
|
||||
|
Loading…
Reference in New Issue
Block a user