Skip to content

Commit 9a73ca2

Browse files
fix(ambiente): username da máquina de hospedagem estava incorreto
1 parent 5363749 commit 9a73ca2

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/monitor.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ const { formaDeExecucao } = require('./utils/ambiente')
1515
const ehAmbienteDeDesenvolvimento = process.env.NODE_ENV === 'serverest-development'
1616
const ehAmbienteDeTestes = process.env.NODE_ENV === 'serverest-test'
1717

18-
const moesifMiddleware = moesif({
19-
applicationId: 'eyJhcHAiOiIxNTA6MTU1MCIsInZlciI6IjIuMCIsIm9yZyI6IjQ5MToxMTIxIiwiaWF0IjoxNTk4OTE4NDAwfQ.e0E6Qhz1o1Jjs5prulHDYEBlv0juruWs_btjq2mong8',
20-
identifyUser: (req, res) => { return formaDeExecucao() },
21-
identifyCompany: (req, res) => { return version }
22-
})
23-
24-
module.exports = app => {
18+
module.exports = async app => {
2519
if (ehAmbienteDeDesenvolvimento || ehAmbienteDeTestes) {
2620
return
2721
}
22+
const user = await formaDeExecucao()
23+
const moesifMiddleware = moesif({
24+
applicationId: 'eyJhcHAiOiIxNTA6MTU1MCIsInZlciI6IjIuMCIsIm9yZyI6IjQ5MToxMTIxIiwiaWF0IjoxNTk4OTE4NDAwfQ.e0E6Qhz1o1Jjs5prulHDYEBlv0juruWs_btjq2mong8',
25+
identifyUser: (req, res) => { return user },
26+
identifyCompany: (req, res) => { return version }
27+
})
2828
app.use(moesifMiddleware)
2929
}

src/utils/ambiente.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ async function formaDeExecucao () {
55
switch (nomeDoUsuario) {
66
case 'root':
77
return 'docker'
8-
case 'd2c2517805206e46be176699782a8820':
8+
case 'no-username-3798':
99
return 'serverest.dev'
1010
default:
1111
return 'npm'

0 commit comments

Comments
 (0)