From 7ba72f0fc7cefb9ad62f2e8d1650b7a2ace39b02 Mon Sep 17 00:00:00 2001 From: Abel Date: Fri, 12 Apr 2024 03:05:12 +0200 Subject: [PATCH] =?UTF-8?q?HOTFIX:=20Cambiado=20m=C3=A9todo=20para=20relle?= =?UTF-8?q?nar=20base=20de=20datos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wikidataextractor-service.js | 58 +++++++++---------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/questionsservice/wikidataExtractor/wikidataextractor-service.js b/questionsservice/wikidataExtractor/wikidataextractor-service.js index 9d7084d1..ccd5137f 100644 --- a/questionsservice/wikidataExtractor/wikidataextractor-service.js +++ b/questionsservice/wikidataExtractor/wikidataextractor-service.js @@ -18,7 +18,7 @@ db.once('open', () => console.log("Connected to MongoDB: %s", mongoUri)); app.use(express.json()); async function extractData() { - var data = await WikiQueries.obtenerPaisYCapital(); + var data = await WikiQueries.obtenerPaisYLenguaje(); console.log(data); var paises = data.map(function (element) { var p = { @@ -53,36 +53,36 @@ cron.schedule(`*/${minutes} * * * *`, () => { */ // Route for extracting countries -app.get('/extract', async (req, res) => { - try { - res.json(await extractData()); - } catch (error) { - res.status(500).json({ message: error.message }) - // res.status(500).json({ error: 'Internal Server Error' }); - } -}); +// app.get('/extract', async (req, res) => { +// try { +// res.json(await extractData()); +// } catch (error) { +// res.status(500).json({ message: error.message }) +// // res.status(500).json({ error: 'Internal Server Error' }); +// } +// }); -// Route for geting countries -app.get('/countries', async (req, res) => { - try { - const paises = await Pais.find({}) - res.json(paises); - } catch (error) { - res.status(500).json({ message: error.message }) - // res.status(500).json({ error: 'Internal Server Error' }); - } -}); +// // Route for geting countries +// app.get('/countries', async (req, res) => { +// try { +// const paises = await Pais.find({}) +// res.json(paises); +// } catch (error) { +// res.status(500).json({ message: error.message }) +// // res.status(500).json({ error: 'Internal Server Error' }); +// } +// }); -// Route for deleting countries -app.delete('/countries', async (req, res) => { - try { - const paises = await Pais.deleteMany({}) - res.json(paises); - } catch (error) { - res.status(500).json({ message: error.message }) - // res.status(500).json({ error: 'Internal Server Error' }); - } -}); +// // Route for deleting countries +// app.delete('/countries', async (req, res) => { +// try { +// const paises = await Pais.deleteMany({}) +// res.json(paises); +// } catch (error) { +// res.status(500).json({ message: error.message }) +// // res.status(500).json({ error: 'Internal Server Error' }); +// } +// }); app.use((err, req, res, next) => {