mirror of
https://gitlab.com/jusax23/wam.git
synced 2024-11-22 14:46:35 +01:00
25 lines
715 B
JavaScript
25 lines
715 B
JavaScript
|
import wam from "./db.js";
|
||
|
|
||
|
|
||
|
const db_struct = {
|
||
|
accounts: {
|
||
|
ID: {type:"int", A_I:true},
|
||
|
accountId: {type:"text" },
|
||
|
name: {type:"text" },
|
||
|
accountkey: {type:"text" },
|
||
|
},
|
||
|
};
|
||
|
|
||
|
//const host="localhost", port=3306, user="user", password="12345678", database="testDB";
|
||
|
const host="rpi2", port=3306, user="jusax", password="testserver", database="test";
|
||
|
|
||
|
const db = new wam({host, port, user, password, database})
|
||
|
|
||
|
db.connect()
|
||
|
.then(()=>db.check(db_struct))
|
||
|
.then(()=>console.log("db is now ready!"))
|
||
|
.catch(err=>{
|
||
|
console.log("Can not connect properly to the Database: ",err);
|
||
|
process.exit();
|
||
|
});
|