I have developed a rest api in nodejs. My database is in Azure SQL.
I have used SWORM npm package to connect to SQL Server.
Following is my code to connect to the Azure SQL database.
var conn = config.get('connectionString');
var db = sworm.db({
driver: 'mssql',
config: {
user: conn.get('user'),
password: conn.get('password'),
host: conn.get('host'),
database: conn.get('database')
}
});
When I execute this code, I get following error
"message": "Failed to connect to undefined:1433 - connect ECONNREFUSED 127.0.0.1:1433", "code": "ESOCKET"
I don't know what's wrong
host?