Hola amigos , como listo los registros de mysql en una vista
Código Javascript
:
Ver originalvar http = require('http');
var mysql = require('mysql');
var connection = mysql.createConnection({
host: '192.168.102.10',
user: 'eStorer',
password: '3st0r3r',
database: 'eStorerDB',
port: 3306
});
connection.connect(function(error){
if(error){
throw error;
}else{
console.log('Conexion correcta.');
}
});
var query = connection.query('SELECT * FROM eStorerDB.station', function(error, result){
if(error){
throw error;
}else{
console.log(result);
}
}
);
connection.end();
var server = http.createServer(function (request, response) {
response.writeHead(200, {"Content-Type": "text/plain"});
response.end("Hola mundo");
});
server.listen(8000);
console.log("Server running at http://127.0.0.1:8000/");
este seria el server ahora me restaria hacer el cliente. estoy bien o mal?