serverest 2.26.13 → 2.26.18

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/.env ADDED
@@ -0,0 +1 @@
1
+ MOESIF_APPLICATION_ID=eyJhcHAiOiIxNTA6MTU1MCIsInZlciI6IjIuMCIsIm9yZyI6IjQ5MToxMTIxIiwiaWF0IjoxNjg4MTY5NjAwfQ.REWsfoWiqfL9quQ97X0VPO8xI-jKZR24k3nSmAgJ1ss
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "serverest",
3
- "version": "2.26.13",
3
+ "version": "2.26.18",
4
4
  "description": "Servidor REST local de forma rápida e simples para estudo de testes de API",
5
5
  "author": "Paulo Gonçalves <author@serverest.paulog.dev> (https://www.linkedin.com/in/paulo-goncalves/)",
6
6
  "license": "GPL-3.0",
@@ -9,6 +9,7 @@
9
9
  "serverest": "src/server.js"
10
10
  },
11
11
  "files": [
12
+ ".env",
12
13
  "docs/",
13
14
  "src/"
14
15
  ],
@@ -50,6 +51,7 @@
50
51
  "connect-timeout": "^1.9.0",
51
52
  "cors": "^2.8.5",
52
53
  "debug": "^4.3.4",
54
+ "dotenv": "^16.3.1",
53
55
  "express": "^4.17.1",
54
56
  "express-async-errors": "^3.1.1",
55
57
  "express-query-int": "^3.0.0",
package/src/server.js CHANGED
@@ -2,6 +2,9 @@
2
2
 
3
3
  'use strict'
4
4
 
5
+ const path = require('path')
6
+ require('dotenv').config({ path: path.resolve(__dirname, '../.env') })
7
+
5
8
  const colors = require('colors')
6
9
  const debug = require('debug')('nodestr:server')
7
10
  const http = require('http')
@@ -21,7 +21,7 @@ module.exports = async app => {
21
21
  }
22
22
  const { porta, timeout, nodoc, nobearer, nosec } = require('../server').argv
23
23
  const moesifMiddleware = moesif({
24
- applicationId: 'eyJhcHAiOiIxNTA6MTU1MCIsInZlciI6IjIuMCIsIm9yZyI6IjQ5MToxMTIxIiwiaWF0IjoxNTk4OTE4NDAwfQ.e0E6Qhz1o1Jjs5prulHDYEBlv0juruWs_btjq2mong8',
24
+ applicationId: process.env.MOESIF_APPLICATION_ID,
25
25
  identifyUser: (req, res) => { return formaDeExecucao() },
26
26
  identifyCompany: (req, res) => { return version },
27
27
  skip: (req, res) => {