+ Moved client to subfolder and added db communication

This commit is contained in:
Alexis
2020-03-20 21:05:28 +01:00
parent c08e07f7b6
commit ef9e98641a
24 changed files with 13069 additions and 12559 deletions

26
index.js Normal file
View File

@@ -0,0 +1,26 @@
// MODULES
const express = require('express');
let connection = require('./connection');
const db = connection.db;
// CONSTANTS
const port = 2814;
const query = "SELECT * FROM spell";
// make to connection to the database.
db.connect( err => {
if (err) { throw err }
console.log("Connected");
db.query(query, (err, result, fields) => {
console.log(result[0]);
});
});
app = express();
app.listen(port, () => {
console.log(`App listening on port ${port}`)
});