arjun kori
arjun kori

Reputation: 1120

How to use sql-injection package in Node.js application?

I want to prevent my app for SQL-Injection attack in Node.js,for that i am using sql-inection package of NPM. My app.js File

var app = express();
var sqlinjection = require('sql-injection');
app.use(sqlinjection);

With this configuration i am directly sending request to server. But with each request to the server the api does not send any response and gives no error or Warning.

I am using this Npm package sql injection npm js

Please guide me to how to use sql-injection in node.js and express.js project. Thanks.

Upvotes: 1

Views: 297

Answers (1)

Suraj Datta
Suraj Datta

Reputation: 46

Please include following lines in your app.js file

app.use('/wordcloud',wordcloud);
app.use('/profanityfilter',profanityfilter);
app.use('/api/notification',notification);
app.use('/api/badge',badgecount);
app.use('/api/csrf',csrfRoute);
app.use(sqlinjection);

After requiring the npm package you must use this sql-injection package at the end of all your router. and it will work fine.

Upvotes: 2

Related Questions