@slingr/slingr-services 0.0.9 → 1.0.1
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 +15 -12
- package/package.json +1 -1
- package/services/httpModule/httpModule.js +2 -0
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 = {
|
|
@@ -369,8 +371,8 @@ const loadSvcWebServices = () => {
|
|
|
369
371
|
loadDeveloperWebServices();
|
|
370
372
|
|
|
371
373
|
webServicesServer.use(compression());
|
|
372
|
-
webServicesServer.use(bodyParser.urlencoded({ extended: true })); // configure app to use bodyParser()
|
|
373
|
-
webServicesServer.use(bodyParser.json()); // this will let us get the data from a POST
|
|
374
|
+
webServicesServer.use(bodyParser.urlencoded({ extended: true, limit: '50gb' })); // configure app to use bodyParser()
|
|
375
|
+
webServicesServer.use(bodyParser.json({ limit: '50gb' })); // this will let us get the data from a POST
|
|
374
376
|
webServicesServer.use('/api', apiRouter); // all of our routes will be prefixed with /api
|
|
375
377
|
webServicesServer.use('/', webhookRouter); // all of our routes will be prefixed with nothing
|
|
376
378
|
|
|
@@ -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
|
|
package/package.json
CHANGED