I am unable to connect to SQL Server Express 2017 from nodejs express web app. I have enabled TCP/IP to sql server express. changed windows authentication to sql server authentication set 'sa' and 'sa1234' as username and password. I am using the following config variable in the code.
I should be able to connect and have a localhost:3000 running


var express = require('express');
var router = express.Router();
/* GET home page. */
router.get('/', function(req, res, next) {
res.render('index', {title:'Express'});
GetData(function(recordset)
{
res.render('index',{products: recordset})
});
// another function
});
function GetData(callback)
{
var sql = require('mssql');
var config = {
user : 'sa',
password:'sa1234',
database:'NodeJsDB',
sever:'DESKTOP-S844OHK\SQLEXPRESS',
};
var connection = new sql.ConnectionPool(config, function(err)
{
// check for error by inspecting the err parameter
if (err) {
console.log(err);
return;
}
var request = new sql.Request(connection);
request.query('SELECT * from Products', function(err, recordset)
{
if (err) {
console.log(err);
}
else {
console.log(recordset);
}
callback(recordset);
connection.close();
});
});
}
module.exports = router;

You need to fix your typo in the server property in your config object. You have sever and not server.
The error is pretty accurate and unambiguous.
Thank you @dhensby , I am really sorry if I was out of place in posting this silly doubt as an issue in here. It works perfectly now. I am new and am learning ins and outs of this place.
No problem <3
Most helpful comment
Thank you @dhensby , I am really sorry if I was out of place in posting this silly doubt as an issue in here. It works perfectly now. I am new and am learning ins and outs of this place.