new design
Todas las comprobaciones han sido exitosas
continuous-integration/drone/push Build is passing

Signed-off-by: ale <ale@manalejandro.com>
Este commit está contenido en:
ale
2025-11-27 03:01:40 +01:00
padre 07f9496ea6
commit eb5d218de9
Se han modificado 12 ficheros con 1076 adiciones y 614 borrados

Ver fichero

@@ -1,6 +1,5 @@
module.exports = (app, client) => {
const constant = require('../constant'),
zlib = require('zlib'),
asyncHandler = require('express-async-handler'),
{ param, validationResult } = require('express-validator')
/**
@@ -513,33 +512,4 @@ module.exports = (app, client) => {
res.status(404).end()
}
}))
/**
* @swagger
* /api/download_index:
* get:
* summary: Retrieve all content of ElasticSearch index.
* description: Retrieve all content of ElasticSearch index.
* responses:
* 200:
* description: A file compressed with gzip.
* content:
* application/gzip:
*/
app.get('/api/download_index', asyncHandler(async (req, res) => {
try {
res.setHeader('Content-Type', 'application/gzip')
res.setHeader('Content-disposition', 'attachment; filename=fediblock-index.json.gz')
const result = await client.search({
index: constant.index,
size: 9999,
query: {
match_all: {}
}
}, { asStream: true, meta: false })
result.pipe(zlib.createGzip()).pipe(res)
} catch (e) {
console.error(e)
res.status(404).end()
}
}))
}