-
Notifications
You must be signed in to change notification settings - Fork 0
/
server.js
21 lines (20 loc) · 860 Bytes
/
server.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import * as promise from "./node_modules/mysql2/promise.js";
export const insertIntoDB = async (positiveID) => {
const connection = await promise.createConnection({
// not me NOT encrypting my data!??
host: "sql9.freesqldatabase.com",
user: "sql9609574",
password: "U6JqdflMxh",
database: "sql9609574",
port:3306,
})
try {
await connection.query(
"INSERT INTO distrowebscraper (positiveID) VALUES ("+positiveID+")"
);
console.log("Inserted ("+positiveID+") into DB")
} catch (error) {
console.log(error)
}
};
insertIntoDB(84082862)