Spaces:
Sleeping
Sleeping
Create database.js
Browse files- database.js +16 -0
database.js
ADDED
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
const mysql = require('mysql2');
|
2 |
+
|
3 |
+
const db = mysql.createConnection({
|
4 |
+
host: '31.220.97.62',
|
5 |
+
user: 'myapi',
|
6 |
+
password: '57rfPPY8bsFBasXX',
|
7 |
+
database: 'myapi',
|
8 |
+
port: 3306
|
9 |
+
});
|
10 |
+
|
11 |
+
db.connect((err) => {
|
12 |
+
if (err) throw err;
|
13 |
+
console.log('Connected to MySQL Database');
|
14 |
+
});
|
15 |
+
|
16 |
+
module.exports = db;
|