@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 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 = {
@@ -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
- 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.9",
3
+ "version": "1.0.1",
4
4
  "description": "Nodejs SDK to create Slingr Services",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -18,6 +18,8 @@ const axiosInstance = require('axios').create(
18
18
  httpsAgent: new https.Agent({
19
19
  rejectUnauthorized: false
20
20
  }),
21
+ maxContentLength: Infinity,
22
+ maxBodyLength: Infinity
21
23
  }
22
24
  );
23
25
  // require('axios-retry')(