-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
35 lines (29 loc) · 849 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
// node --experimental-json-modules .
import { Competition } from './js/compFunctions.js';
import { DiscordClient } from './js/discordClient.js';
import { WebServer } from './js/server.js';
import mysql from 'mysql';
var connection = mysql.createConnection({
host: '',
user: '',
password: '',
database: ''
});
connection.connect(err => {
const competition = new Competition(connection);
const discordClient = new DiscordClient(connection, competition);
const webServer = new WebServer(competition, discordClient);
});
async function query(connection, query) {
let myresult = undefined;
await connection.query(query, (err, result, fields) => {
if (err) {
console.log(err);
}
console.log(result);
myresult = result;
});
return myresult;
}
// connection.destroy()
// https://www.npmjs.com/package/mysql