Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DeprecationWarning: Buffer() is deprecated due to security and usability issues. #672

Open
hemanthvhs opened this issue Aug 27, 2019 · 2 comments

Comments

@hemanthvhs
Copy link

I'm using all latest versions node - 10,npm -6.9 ,mssql-5.1.0, msnodesqlv8-0.8.3

I have deployed the API in iis and when I'm moving to iisnode.local:88, I'm getting the error :[DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.

Where exactly this needs to be modified ?

My Code :

var express = require('express');
var app = express();

app.get('/', function (req, res) {

var sql = require("mssql");

// config for your database
var config = {
  driver : 'msnodesqlv8',
  server : "abc", 
  port : 1433,
  options: {
    trustedConnection: true
  },
    database: 'DBtest' 
};

// connect to your database
sql.connect(config, function (err) {

    if (err) console.log(err);

    // create Request object
    var request = new sql.Request();
       
    // query to the database and get the records
    request.query('select * from employee', function (err, recordset) {
        
        if (err) console.log(err)

        // send records as a response
        res.send(recordset);
        
    });
});

});

var server = app.listen(5000, function () {
console.log('Server is running..');
});

@savanipoojan78
Copy link

did you find any answer???

@dorsulak
Copy link

dorsulak commented Mar 3, 2020

this helped me:
Azure#60

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants