mirror of
https://github.com/danbulant/mysqlExporter
synced 2026-06-19 22:51:28 +00:00
fix config
This commit is contained in:
parent
26381d5e4b
commit
7859d8acb4
1 changed files with 3 additions and 1 deletions
4
index.js
4
index.js
|
|
@ -2,7 +2,6 @@ const express = require("express");
|
|||
const fs = require("fs");
|
||||
const mysql = require("mysql");
|
||||
const opn = require('opn');
|
||||
const pool = mysql.createPool(config.mysql);
|
||||
const app = express();
|
||||
|
||||
var apiOnly = false;
|
||||
|
|
@ -15,6 +14,9 @@ if(!fs.existsSync(__dirname + "/static/index.html")){
|
|||
apiOnly = true
|
||||
}
|
||||
|
||||
const config = JSON.parse(fs.readFileSync("./config.json", "utf-8"));
|
||||
const pool = mysql.createPool(config.mysql);
|
||||
|
||||
function query(conn, data, params = []) {
|
||||
return new Promise((resolve, reject) => {
|
||||
conn.query(data, params, (err, resp, fields) => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue