Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[generic] events #4

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions services/generic-events/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# events-service


# Configuration
```yaml
```
48 changes: 48 additions & 0 deletions services/generic-events/bin/events-service
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#!/usr/bin/env node
const service = require('../src');
const yargs = require('yargs');
const { resolve } = require('path');
const package = require('../package.json');

yargs
.usage('Usage: $0 [--config <path>]')
.count('verbose')
.alias('v', 'verbose')
.describe('verbose', 'The Log Level')
.string('config')
.alias('c', 'config')
.describe('config', '<path> Path to the config file')
.alias('h', 'help')
.string('db')
.describe('db', '<path> Path to the Database')
.help()
.version(package.version);

const { argv } = yargs;

const options = {};

if (argv.verbose) {
switch (argv.verbose) {
case 1:
options.logLevel = 'info';
break;
case 2:
options.logLevel = 'debug';
break;
case 3:
options.logLevel = 'trace';
break;
}
}

if (argv.config) {
options.config = resolve(__dirname, '..', argv.config);
}

if (argv.db) {
options.db = resolve(__dirname, '..', argv.db);
}

service
.start(options);
Loading