feat: Add base files
This commit is contained in:
18
backend/db.js
Normal file
18
backend/db.js
Normal file
@@ -0,0 +1,18 @@
|
||||
const mysql = require('mysql2');
|
||||
|
||||
const connection = mysql.createConnection({
|
||||
host: 'db',
|
||||
user: 'root',
|
||||
password: 'root',
|
||||
database: 'vulnapp',
|
||||
});
|
||||
|
||||
connection.connect(err => {
|
||||
if (err) {
|
||||
console.error('DB connection failed:', err.stack);
|
||||
return;
|
||||
}
|
||||
console.log('Connected to MySQL');
|
||||
});
|
||||
|
||||
module.exports = connection;
|
||||
Reference in New Issue
Block a user