2020-07-07 09:03:36 +00:00
|
|
|
const options = require('minimist')(process.argv.slice(2));
|
|
|
|
const winston = require('winston');
|
|
|
|
|
2020-07-03 05:07:40 +00:00
|
|
|
const ConsulCatalog = require('./lib/consulcatalog');
|
2020-07-07 09:03:36 +00:00
|
|
|
const config = options.hasOwnProperty('config') ? require(options.config) : require('./config');
|
|
|
|
|
|
|
|
const logger = winston.createLogger({
|
|
|
|
transports: config.logging.transports,
|
|
|
|
});
|
|
|
|
|
2020-07-03 05:07:40 +00:00
|
|
|
|
|
|
|
const catalog = new ConsulCatalog(logger, config);
|
|
|
|
|
|
|
|
// TODO detect if the connection is down for too long, allow a custom notification to be sent
|