From f614ee2550fba9f9cf4bf373c8fdae4b0f3e231f Mon Sep 17 00:00:00 2001 From: lir Date: Mon, 11 Sep 2017 18:57:48 +0800 Subject: [PATCH] add custom port --- index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index 86f6e90..e828689 100644 --- a/index.js +++ b/index.js @@ -10,10 +10,10 @@ const metrics = require('./metrics').metrics; let config = { connect: { server: process.env["SERVER"], - port: process.env["PORT"] || 1433, userName: process.env["USERNAME"], password: process.env["PASSWORD"], options: { + port: process.env["PORT"] || 1433, encrypt: true, rowCollectionOnRequestCompletion: true } @@ -110,10 +110,10 @@ app.get('/metrics', async (req, res) => { }); const server = app.listen(config.port, function () { - debug(`Prometheus-MSSQL Exporter listening on local port ${config.port} monitoring ${config.connect.userName}@${config.connect.server}:${config.connect.port}`); + debug(`Prometheus-MSSQL Exporter listening on local port ${config.port} monitoring ${config.connect.userName}@${config.connect.server}:${config.connect.options.port}`); }); process.on('SIGINT', function () { server.close(); process.exit(0); -}); \ No newline at end of file +});