Posts

Showing posts with the label NodeJS

Code Snippet : Windows NTLM POST using Node JS

let ntlm = require('request-ntlm-lite'); let postData = 'user=test';   //anything let headers = {'Content-Type': 'application/x-www-form-urlencoded'}; let ntlmOptions = {                  url: 'postUrl', username: 'username', password: 'password', workstation:'', rejectUnauthorized: false, //disable ssl certificate error ntlm_domain: 'domain_name', json: true, headers:headers }; ntlm.post(ntlmOptions, postData, function(error, response, body){ console.log(error); console.log(response);                      });

Database Configuration to connect with named instance SQL Server with mssql for node.js

After some frustration, it found that Node JS mssql (5.0.5) doesn't like instance name in config file to make mssql.ConnectionPool(config)- Works     dbConfig: {         "user": "user",         "password": "pass",         "server": "myserver",  //  Without instance name          "database": "dbname",         "port":1433,         "driver": "tedious",         "options": {             "instance":"mylocaldevdatabase",             "trustedConnection": true           }         } Doesn't Work