Re: [nodejs] Re: Use of global variable in node js

2017-04-20 Thread tpx1
Hi, I will mention that this piece of code has a big security issue. You should never combine a sql query string with your parameter directly. If email is a string like ' OR 1=1 -- you will login without any login information. For more information see https://en.wikipedia.org/wiki/SQL_injection

[nodejs] Re: Node application - request & response

2017-04-20 Thread Zlatko
On Wednesday, April 19, 2017 at 2:42:02 AM UTC+2, SC wrote: > > Hi, > > I have a nodejs application, in which I am making a call to another rest > service. > > When I directly call that rest service from a simple request response node > application, it works just fine from the command line. > >

Re: [nodejs] Node application - request & response

2017-04-20 Thread tpx1
Hi, there could be many problems and without any code, it is hard to see, where a problem might be. Check variables, if you hide the response variable of your application in the response statement. Another problem could be, that your application has to finish his work in the callback of the reque

Re: [nodejs] N00b trying to understand simple app

2017-04-20 Thread tpx1
Hi, the "function Switch" is a build plan for an object, that has a method setState. This method will be defined in the constructor method of the Switch, because you will use variables, which are hide from the outside, by defining them in the constructor. By here there is no need to do it so, bec

Re: [nodejs] ERROR EXECUTING NPM ON WIN 8.1 64 BITS SPANISH LANGUAGE

2017-04-20 Thread DaneiL
can you remove the prefix -g? "CALL "C:\Program Files\nodejs\node,exe" "C;\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" *prefix -g* " is not recognized as an interal o external program executable batch program or file. I think in windows does not existe -g prefix. But i never used node

Re: [nodejs] ERROR EXECUTING NPM ON WIN 8.1 64 BITS SPANISH LANGUAGE

2017-04-20 Thread tpx1
Hi, I think it shouldn't be node,exe and is an error in the npm install process. Look for an npm.cmd on your hard drive and change it manually. Thomas Am 17.04.2017 um 20:50 schrieb Guido Cardona: > Every time i run npm as for example > > npm -v > > the software shows: a warning message, it se

[nodejs] Re: Use of global variable in node js

2017-04-20 Thread endling1
function login(email, password, callback){ var email = email.trim().toLowerCase(); var password = password.trim(); var queryString = "SELECT * FROM users where Email ="+"'"+email+"' AND Password = '"+password+"'"; con.query(queryString, function(err, rows){ if(err){

[nodejs] Node JS [Mean Stack] on linux instance behaving inconsistently. Json data not being sent. MongoError: cursor killed or timed out error appears often

2017-04-20 Thread Vasumathy Seenuvasan
I have a Node JS application [MEAN stack - Node version: `v0.10.40`, Mongoose: `3.8.8`, Express: `4.0.0`.] running on a linux instance. It was working fine but during the past few days the app is responding really slow. 1. For mongo queries, the below error is thrown `MongoError: cursor

Re: [nodejs] Node application - request & response

2017-04-20 Thread DaneiL
Are you using CORS? maybe that could be the problem. Did you try making a request using curl? On 18 April 2017 at 10:02, SC wrote: > Hi, > > I have a nodejs application, in which I am making a call to another rest > service. > > When I directly call that rest service from a simple request respon

[nodejs] [libuv-related] SEGFAULT when GC sweep on low memory system, not on regular system

2017-04-20 Thread Thomas Barusseau
Hello, I'm working with a printer device and overhauling some node.js code. Previously, communication was done with set interval reads, with writes in between. I thought that it could be a good idea to implement a native C polling interface using node-gyp to compile a node.js-compatible addon.