@slingr/slingr-services 0.0.9 → 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.
- package/index.js +13 -10
- 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
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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
|
-
|
|
438
|
+
await servicesSettings.refreshCache();
|
|
436
439
|
};
|
|
437
440
|
svc.start = startSvc;
|
|
438
441
|
|