2018-06-28 02:30:26 +02:00
|
|
|
const logger = require('winston');
|
|
|
|
const db = require('../../../models');
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
Route to update and return tor exit nodes that can connect to this ip address
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
const getTorList = (req, res) => {
|
2018-06-28 19:39:46 +02:00
|
|
|
db.Tor.refreshTable()
|
2018-08-01 01:43:08 +02:00
|
|
|
.then(result => {
|
2018-06-28 02:30:26 +02:00
|
|
|
logger.debug('number of records', result.length);
|
|
|
|
res.status(200).json(result);
|
|
|
|
})
|
|
|
|
.catch((error) => {
|
|
|
|
logger.error(error);
|
|
|
|
res.status(500).json({
|
|
|
|
success: false,
|
|
|
|
error,
|
2018-08-01 01:43:08 +02:00
|
|
|
});
|
2018-06-28 02:30:26 +02:00
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
module.exports = getTorList;
|