Skip to content

Commit 9d31551

Browse files
chore(monitor): mapear as configurações utilizadas pelos usuários do ServeRest que usam NPM e Docker
1 parent 95ea7ae commit 9d31551

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

src/server.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@ const DEFAULT_PORT = 3000
1515
const argv = require('yargs')
1616
.default({
1717
porta: conf.porta,
18-
timeout: conf.tokenTimeout
18+
timeout: conf.tokenTimeout,
19+
nodoc: false,
20+
nobearer: false,
21+
nosec: false
1922
})
2023
.boolean(['nobearer', 'nodoc', 'nosec'])
2124
.number(['timeout', 'porta'])
@@ -45,6 +48,8 @@ const argv = require('yargs')
4548
.epilog('Abra uma issue em github.com/ServeRest/ServeRest/issues')
4649
.argv
4750

51+
module.exports = { argv }
52+
4853
conf.tokenTimeout = argv.timeout
4954
conf.semHeaderDeSeguranca = argv.nosec
5055
conf.semBearer = argv.nobearer

src/utils/logger.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ module.exports = async app => {
1919
if (ehAmbienteDeDesenvolvimento || ehAmbienteDeTestes) {
2020
return
2121
}
22+
const { porta, timeout, nodoc, nobearer, nosec } = require('../server').argv
2223
const moesifMiddleware = moesif({
2324
applicationId: 'eyJhcHAiOiIxNTA6MTU1MCIsInZlciI6IjIuMCIsIm9yZyI6IjQ5MToxMTIxIiwiaWF0IjoxNTk4OTE4NDAwfQ.e0E6Qhz1o1Jjs5prulHDYEBlv0juruWs_btjq2mong8',
2425
identifyUser: (req, res) => { return formaDeExecucao() },
@@ -34,6 +35,17 @@ module.exports = async app => {
3435
return true
3536
}
3637
},
38+
getMetadata: (req, res) => {
39+
return {
40+
conf: {
41+
porta,
42+
timeout,
43+
nodoc,
44+
nobearer,
45+
nosec
46+
}
47+
}
48+
},
3749
noAutoHideSensitive: true
3850
})
3951
app.use(moesifMiddleware)

0 commit comments

Comments
 (0)