Re: [nodejs] Authentication + query at the same code

2017-01-20 Thread DaneiL
I have an example on my github profile, doing getting a token via post. Using node and express. https://github.com/danizavtz/tokenAuth U can see the code @ server/services/login.service.js I don't get the question 'search string using get' thing. You mean query params in the URL? Something like: l

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

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] Why would a NodeJS app give bad data when it is under stress?

2017-05-04 Thread DaneiL
Here is a better link: Sorry https://medium.com/netflix-techblog/node-js-in-flames-ddd073803aa4 On 4 May 2017 at 09:28, DaneiL wrote: > Hello, i read your entire case, it seems to me, that its not related with > node itself, but with hapijs. > Your statement made me reckon a study cas

Re: [nodejs] Why would a NodeJS app give bad data when it is under stress?

2017-05-04 Thread DaneiL
Hello, i read your entire case, it seems to me, that its not related with node itself, but with hapijs. Your statement made me reckon a study case made by Netflix. That you can see here: https://www.infoq.com/news/2014/12/expressjs-burned-netflix I think it should give you some insights of what is

Re: [nodejs] Why may a mongoose document not get saved?

2017-05-29 Thread DaneiL
Here is a code that i use with moongose and mongo db, i don't know where should be your error, maybe with the parameters of middleware functions. exports.newUser = function(request, response) { console.log(request.body);var user = new User({ "fullname": request.body.fullname,"c

Re: [nodejs] update from bd with success but returns undefined to my ontroller in Node.js

2017-05-30 Thread DaneiL
I think, it is happening, because you are calling the funcion done() before the promise resolution. In servicesDatabase.js On 30 May 2017 at 11:44, Catia Matos wrote: > Hy everyone, I'm having some troubles with my rest api. I have in my ui a > button where I click to update the state of a bus (

Re: [nodejs] Mocha testing

2017-07-17 Thread DaneiL
Yes, it is possbile. You can check my repo in github, with an example using nodejs, express , mocha and supertest. https://github.com/danizavtz/tokenAuth On 17 July 2017 at 03:27, Prashant Awasthi wrote: > Can we use use a mocha in a test application to test another node js > application ? >

Re: [nodejs] outside for loop var value is undefined

2017-07-24 Thread DaneiL
You have to put this line console.log("count repetidos 2",countRepetidos);// value undefined before the return function return resolve(countRepetidos); var countRepetidos;if(obj.data.list!={} && obj.data.list.length>0){ var aux = obj.data["list"]; countRepetidos=0; for(var i=0;i

Re: [nodejs] NodeJS REST API Application - Structure

2017-08-07 Thread DaneiL
I have a proof of concept project , u can follow to use in your rest api. there is an express app that only handles json. On 1 August 2017 at 11:29, InfantJoseph S wrote: > Am a newbie here. I want to develop a NodeJS application which serves only > to expose REST

Re: [nodejs] exercise 2

2017-08-13 Thread DaneiL
Have you tryed for? On 7 August 2017 at 23:22, Stephany Prodromos wrote: > Hi guys I just started learning node today, and am a little confused as to > how to go about the second exercise > > at first i had: > > var num1 = +process.argv[2]; > var num2 = +process.argv[3]; > var result = num1

Re: [nodejs] Calling node api through postman and response is enable javascript error

2017-08-18 Thread DaneiL
can u make a request using curl? does it return the expected result? On 17 August 2017 at 08:01, Avinash Kadam wrote: > When calling API https://mywebsite.com/api/register through browser and > it returns correct response from server as > { "error": false, "message": "Hello World" } > If we hit

Re: [nodejs] Authentication front-end for accessing local services

2017-08-23 Thread DaneiL
Hello, you could use jwt.io. It requires a service to make a login, after that you can share a token between your apps so that only logged users can make requests to your api. Here is a working example, a microservice for login, for you use a shared key between your apps: https://github.com/danizav

Re: [nodejs] Should I use mock or sqlite to make unit tests with database on nodejs app?

2017-09-27 Thread DaneiL
Hello, In my case i use sql during tests. There is a basic example in this project in my github. Mostly i did there came from ideias i got from brianc the currently developer supporting the pg (postgres-node) lib. Here is my github https://github.com/danizavtz/tokenAuth I only see pros. I coul

Re: [nodejs] Can I do an automatic pause in node js?

2017-10-21 Thread DaneiL
Are u using interprocess communication? or you are talking about upload with web browser? On 20 October 2017 at 08:18, Athira G wrote: > Hi, > > When I am uploading multiple files. If the network down or gone can I > trigger this using node js. Then do a pause for my current task and start > ag

Re: [nodejs] Synchronous for loop

2017-10-24 Thread DaneiL
Can u post an example? Create gist or put some example code, so we can inspect what could be wrong in your code? On 24 October 2017 at 17:56, wrote: > Hi > I am new to node js. I am facing an issue. > I have 3 ids. I am iterating in for loop. For each value I am calling web > service. The web s

Re: [nodejs] Preciso de um script que rode um teste de carga e demostre qual o Throughput máximo que o servidor consegue atingir.

2017-10-25 Thread DaneiL
Olá, cara eu não conheço nenhum script que faça isso. Porém, existe o apache Bench que mostra algumas estatisticas do tipo que você quer, com ele vc também pode fazer o benchMark do fluxo máximo que o seu servidor aguenta. No linux vc vai rodar o comando: ab Outra solução que seria mais adequada (

Re: [nodejs] Backend Nodejs Automation testing options

2017-10-31 Thread DaneiL
Hello, i have been using mocha with supertest for doing the backend tests. U can look at my github for an example of how can u use. I use with express. Checkout this project for an more detailed information. https://github.com/danizavtz/tokenauth On 30 October 2017 at 21:32, Naga Sai A wrote:

Re: [nodejs] Re: Bunyan or winston ? how do they differ to each other ?

2017-10-31 Thread DaneiL
In my personal applications i am using *morgan*. Never needed nothing too much for this, everything i need (until now) it has implemented. It play nice with my testing framework where i can switch off the logs. On 31 October 2017 at 09:45, Jaret Flores wrote: > I don't know too much about Winsto

Re: [nodejs] Multiple Instances of net Sockets

2017-11-07 Thread DaneiL
Yes. According to the code you sent.. I think you are overwriting the variable. its: Scales = require( './scales.class.js' ); var one = new Scales( "10.0.20.104", 8899 ); one.Init().Process(); var one = new Scales( "10.0.20.105", 8898 ); one.Init().Process(); it should be: Scales = require( './sca

Re: [nodejs] NPM warnings - how to rectify?

2018-02-28 Thread DaneiL
The deprecated warning can be corrected by just updating the version of you package with warning. On 28 February 2018 at 11:54, DaneiL wrote: > Add this atributes to your package.json. > "repository": { > "type": "git", > "url": "git+

Re: [nodejs] Connection error with nodejs while connecting to postgres.

2019-02-18 Thread DaneiL
if you can connect via psql command, you should connect via nodejs instance. psql -U -h On Mon, 18 Feb 2019 at 14:05, wrote: > I'm able to connect to postgre database in my local machine and postgre > database with public ip using nodejs. But im unable to connect to postgre > instance in other

Re: [nodejs] Need help creating a user login and registration form with mysql i don' know how to.

2019-02-19 Thread DaneiL
Hello, i have this project at github: https://github.com/danizavtz/tokenAuth it uses postgres, but u can use as a starter project for you mysql instance, it uses docker. On Mon, 18 Feb 2019 at 22:42, Jose Perez wrote: > Hi guys I need help on creating a login/setup and authorization screen > wit

Re: [nodejs] Simple voting application with node.js

2019-10-15 Thread DaneiL
is it a suitable solution use another solution? Have you ever used https://www.mentimeter.com/ ? Does it solves the problem? On Tue, 15 Oct 2019 at 20:49, Prasanna Sivaramakrishnan < prasanna.skrish...@gmail.com> wrote: > Hi All, > > I am looking to create a simple voting application which can co