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) => {