Commit 18c6f924d15dd29b7993d8f1b8b507533bdcec73

Authored by Adhidarma Hadiwinoto
1 parent c8d1761567
Exists in master

Init config.smstools.json

Showing 3 changed files with 13 additions and 0 deletions Side-by-side Diff

1 1 /node_modules/
2 2 /config.json
  3 +/config.smstools.json
3 4 /tmp/
4 5 /logs/
5 6 config_*.json
... ... @@ -9,6 +9,7 @@ const config = require('komodo-sdk/config');
9 9 global.KOMODO_LOG_LABEL = `KOMODO-CENTER@${(config && typeof config.name === 'string') ? config.name.toUpperCase() : 'SMSTOOLS'}`;
10 10 process.title = global.KOMODO_LOG_LABEL;
11 11  
  12 +require('./lib/smstools-configurator');
12 13 require('./lib/apiserver');
13 14  
14 15 const messagingClient = require('komodo-center-messaging-client-lib');
lib/smstools-configurator/index.js
... ... @@ -0,0 +1,11 @@
  1 +const fs = require('fs');
  2 +const logger = require('komodo-sdk/logger');
  3 +
  4 +if (!fs.existsSync('config.smstools.json')) {
  5 + logger.info('config.smstools.json does not exists, creating it');
  6 + fs.writeFileSync('config.smstools.json', JSON.stringify({}, 0, 4));
  7 +}
  8 +
  9 +const smstoolsConfig = require('../../config.smstools.json');
  10 +
  11 +logger.info('Our SMSTOOLS config read', { smstoolsConfig });