download index
Some checks reported errors
continuous-integration/drone/push Build was killed

This commit is contained in:
ale 2024-09-23 04:30:26 +02:00
parent df2902613d
commit 755e88ba07

View File

@ -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()