feat: working data download and indexing

This commit is contained in:
2018-11-01 16:57:10 -07:00
parent 2067fd63ca
commit 571e6dfd75
12 changed files with 289 additions and 22 deletions

23
bin/index.js Normal file
View File

@@ -0,0 +1,23 @@
/* eslint no-global-assign: 0 no-console: 0 */
require = require('esm')(module);
const getopts = require('getopts');
const mod = require('../src/index.mjs').default;
const { index, ...elasticsearch } = getopts(process.argv.slice(2), {
string: ['host', 'log'],
alias: {
h: 'host',
l: 'log',
i: 'index',
},
default: {
host: 'localhost:9200',
log: 'error',
index: 'adsb-data',
},
});
mod(index, { elasticsearch }).catch(err => {
console.error(err);
process.exit(1);
});