Nodejs

Build an Api Proxy Server

Api proxy A proxy is something sitting between the application and backend or some third party services. we can benifit from a proxy in many places Translate request formats Avoid expose the token, key etc. for the integration with some third party sevices Perform data transformation Build an Api proxy server Install packages npm i express dotenv cors needle npm i -D nodemon npm i express-rate-limit apicache proxy serice sample Implement a proxy call to https://api.

Connecting to MSSQL With Windows Authentication in Nodejs

Install npm package npm install mssql msnodesqlv8 --save Sample code const sql = require('mssql/msnodesqlv8'); var dbConfig = { connectionTimeout : 30000, database: "<DB Name>", server: "<server Name>", options: { trustedConnection: true, } }; var dbConfig2 = { connectionTimeout : 30000, connectionString: 'Driver={SQL Server Native Client 11.0};Server=<Server Name>;Database=<DB Name>;Trusted_Connection=yes;', options: { } }; (async () => { try { console.log("start"); await sql.connect(dbConfig); // both format of dbConfig or dbConfig2 will work const result = await sql.