Questions tagged as 'node.js'

1
answer

NodeJs api with promisses

I'm developing an API in TypeScript with NodeJS and MariaDB; when I do an operation with the bank, right below I have a if to check if an error has occurred. productDao.save({name:"Notebook Dell", price:"5000"}, function(err, res){ if(err...
asked by 29.06.2017 / 19:46
1
answer

How to debug NodeJS code?

In my early studies in web development with NODEJS I have the following doubt: a tool to debug NODEJS codes in a web system?     
asked by 14.11.2017 / 13:47
1
answer

NodeJS module running before the EventListener

I am creating a module for node and when performing some tests with eventListener of type change in a field of type file , the module is executed before a file is inserted in the field. p> exports.preview = (fileInput...
asked by 16.03.2017 / 21:54
1
answer

Multi-table query Node + Mysql

Considering the need to bring the result of a second table, based on the result of the first one, how would you do it with NodeJS? In PHP I would bring the result, and within while I would make another query by passing the ID of the first...
asked by 29.08.2017 / 02:57
1
answer

Basic Authentication Nodejs

I'm starting now with NodeJS (I came from PHP), and I'm creating an API for a my app, I would like to know, how do I make queries based on Auth Basic, I'm not really sure how it works an app for a client, which I always needed to send in the head...
asked by 29.08.2017 / 00:01
1
answer

How do I return the value of a query in nodejs

Well, I have the following code: pool.query('SELECT * FROM 'info' WHERE 'id' = 1', function(err, row) { var jogo = row[0].jogo; console.log(jogo); }); The problem is, if I take the var game from the function, it no long...
asked by 26.03.2017 / 04:26
1
answer

How do I check with nodejs, if a table is unregistered?

Well, I want to check a table with nodejs to see if it has no records. How can I do this so that it does not give error with nodejs? Thank you.     
asked by 30.03.2017 / 06:53
1
answer

Get size of a requisition

On my system, I get several requests, I would like to know if there is a way to get the size of this request ( req ) received in kbs , to get a sense of how much bandwidth was spent for this send .     
asked by 10.03.2017 / 13:32
1
answer

Node JS, Socket.IO Rooms and namespaces

I'm developing a map-based android app that will create chat rooms in some pre-determined places and places where users need them. I did some research with mechanisms that I could use in my application and came across the concept of namespac...
asked by 12.07.2017 / 15:47
1
answer

Two listen on the same server

I am creating a game server and in this game server will have several channels belonging to the same server, there I was thinking if it is possible to create two listen on the same server, var net = require('net'); var server = net.createServe...
asked by 05.05.2017 / 01:10