I have a question regarding the receipt of SQL data in a Javascript array. I have the login information and everything else, regarding the server, but the issue is not the connection, it's saving the data in an array. Example: nameArray [username, email] (how to require this SQL info?)
app.get('/',(req, res) => {res.render('pages/home')})
function loginClient(){
var conn = new sql.Connection(dbConfig);
conn.connect().then(function(){
var req = new sql.Request(conn);
req.query("SELECT [CodCliSite],[RazaoSocial],[Email],[Pass] FROM [SITE].
[dbo].[Clientes]").then(function(recordset){
res.contentType('application/json');
res.send(JSON.stringify(recordset));
console.log(recordset);
conn.close();
}).catch(function(err){
console.log(err);
conn.close();
});
}).catch(function(err){
console.log(err);
});
}
return loginClient();