Release v1.0.0 🎉

This commit is contained in:
Christian Kellner
2018-01-20 20:23:27 +01:00
commit c6cffe029d
33 changed files with 2168 additions and 0 deletions

25
lib/services/stats.js Normal file
View File

@@ -0,0 +1,25 @@
const config = require('../../conf/config.json');
let lastScrape = {};
if (config.enableStats) {
const http = require('http');
http
.createServer((req, res) => {
res.writeHead(200, { 'Content-Type': 'application/json' });
res.end(
JSON.stringify({
config,
lastScrape
})
);
})
.listen(config.statsPort, '127.0.0.1');
}
exports.setLastScrape = (serviceName, numberFound) => {
lastScrape[serviceName] = lastScrape[serviceName] || [];
lastScrape[serviceName].push({
scapeTime: new Date().toString(),
numberFound: numberFound
});
};