31 lines
628 B
JavaScript
31 lines
628 B
JavaScript
/*
|
|
SkeptCOM [IO] | Via un json, on va rediriger qui envoye a quoi
|
|
*/
|
|
|
|
const routes = require('../conf/routes.json')
|
|
const skepticonf = require('../conf/skepticom.json')
|
|
const services = {}
|
|
|
|
module.exports = (who) => {
|
|
|
|
if (!who || !routes[who]) return console.error(`ERROR routage`)
|
|
|
|
services[who] = require('./skeptIO')(who)
|
|
|
|
function send(data) {
|
|
services[who].send('logs', '', data)
|
|
for (let i in routes[who]) {
|
|
services[who].send(i, routes[who][i], data)
|
|
}
|
|
}
|
|
|
|
function log(data) {
|
|
services[who].send('logs', '', data)
|
|
}
|
|
|
|
return {
|
|
send,
|
|
log
|
|
}
|
|
}
|