1
0
mirror of https://github.com/yldio/copilot.git synced 2024-11-11 05:40:11 +02:00
copilot/control-tower/bin/control-tower
2017-05-15 19:26:40 +01:00

22 lines
571 B
JavaScript

#!/usr/bin/env node
'use strict';
const Fs = require('fs');
const ControlTower = require('../');
const cert = process.env.CMON_CERT_PATH ? Fs.readFileSync(process.env.CMON_CERT_PATH) : process.env.CMON_CERT;
const key = process.env.CMON_KEY_PATH ? Fs.readFileSync(process.env.CMON_KEY_PATH) : process.env.CMON_KEY;
const datacenter = 'cmon.us-sw-1.triton.zone:9163';
const tower = new ControlTower({ cmon: { cert, key, datacenter } });
tower.start((err) => {
if (err) {
console.error(err);
process.exit(1);
}
console.log('Control Tower Started');
});