Commit 16e1a790 authored by Matthieu - Greep's avatar Matthieu - Greep

Add informations on SQL connect

parent a2830fa1
Pipeline #454 passed with stage
in 47 seconds
...@@ -17,7 +17,14 @@ const connection = mysql.createConnection({ ...@@ -17,7 +17,14 @@ const connection = mysql.createConnection({
multipleStatements: true, multipleStatements: true,
}); });
connection.connect(); connection.connect((err)=>{
if (err){
console.error('Impossible to connect to MySQL server. Code: ' + err.code)
process.exit(1)
} else {
console.log('[SQL] Connected to the MySQL server! Connexion ID: ' + connection.threadId)
}
})
/** /**
* Get the authorization token from the request header * Get the authorization token from the request header
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment