mirror of
https://github.com/danbulant/mysqlExporterDeno
synced 2026-07-08 04:30:41 +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 fs = require("fs");
|
||||||
const mysql = require("mysql");
|
const mysql = require("mysql");
|
||||||
const opn = require('opn');
|
const opn = require('opn');
|
||||||
const pool = mysql.createPool(config.mysql);
|
|
||||||
const app = express();
|
const app = express();
|
||||||
|
|
||||||
var apiOnly = false;
|
var apiOnly = false;
|
||||||
|
|
@ -15,6 +14,9 @@ if(!fs.existsSync(__dirname + "/static/index.html")){
|
||||||
apiOnly = true
|
apiOnly = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const config = JSON.parse(fs.readFileSync("./config.json", "utf-8"));
|
||||||
|
const pool = mysql.createPool(config.mysql);
|
||||||
|
|
||||||
function query(conn, data, params = []) {
|
function query(conn, data, params = []) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
conn.query(data, params, (err, resp, fields) => {
|
conn.query(data, params, (err, resp, fields) => {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue