I always considered javascript as client side script with no possibilites working with server side but due to node.js it has changed. But I still don't understand how it could work, e.g. look at this code :
var mysql = require('mysql');
var connection = mysql.createConnection({
host : 'localhost',
user : 'dbuser',
password : 's3kreee7'
});
connection.connect();
connection.query('SELECT 1 + 1 AS solution', function(err, rows, fields) {
if (err) throw err;
console.log('The solution is: ', rows[0].solution);
});
connection.end();
javascript is displaying on client side, so everyone can see login and password to DB? Or in node code isn't displaying on client side ?
So in case if smne have phpmyadmin directly on his server like website/phpmyadmin or website/mysql it allows hackers login to it ? Sorry if it's dumb question, I never worked with node before.