@slingr/slingr-services 0.0.8 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +13 -10
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -3,19 +3,21 @@
3
3
  //////////////////
4
4
  //We load env vars from dotenv if we are in local deployment
5
5
  //The file loaded will depend on the NODE_ENV var.If not defined, it dafaults to .env
6
+
6
7
  if (process.env._local_deployment === undefined) {
7
8
  let envPath = process.env.NODE_ENV === undefined ? './.env' : `./.${process.env.NODE_ENV}.env`;
8
9
  require('dotenv').config({ path: envPath});
9
10
  }
10
- const
11
- util = require('util'),
12
- fs = require('fs'),
13
- http = require('http'),
14
- https = require('https'),
15
- axios = require('axios'),
16
- compression = require('compression'),
17
- express = require('express'),
18
- bodyParser = require('body-parser');
11
+
12
+ const util = require('util');
13
+ const fs = require('fs');
14
+ const http = require('http');
15
+ const https = require('https');
16
+ const axios = require('axios');
17
+ const compression = require('compression');
18
+ const express = require('express');
19
+ const bodyParser = require('body-parser');
20
+ const servicesSettings = require('./services/settings/settings');
19
21
 
20
22
  //The instance of the service.
21
23
  let svc = {
@@ -429,10 +431,11 @@ const startSvc = async () => {
429
431
  ///////////////////////////////////////////////////////////////////////////////////////////////////
430
432
  // Service Started
431
433
  ///////////////////////////////////////////////////////////////////////////////////////////////////
434
+
432
435
  appLogger.info('Service [' + settings.svcName + '] started');
433
436
  svc.hooks.onSvcStart();
434
437
 
435
- if (settings.isUsingProxy) require('./services/settings/settings').refreshCache();
438
+ await servicesSettings.refreshCache();
436
439
  };
437
440
  svc.start = startSvc;
438
441
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@slingr/slingr-services",
3
- "version": "0.0.8",
3
+ "version": "1.0.0",
4
4
  "description": "Nodejs SDK to create Slingr Services",
5
5
  "main": "index.js",
6
6
  "repository": {