Questions tagged as 'node.js'

0
answers

Location using NodeJS

I'm starting with Node and I'm creating an application where I wanted to get the current location of the user and with this location I can make comparisons and if possible save in the Bank. I think it will work this way: The user will cre...
asked by 21.12.2016 / 01:58
2
answers

Formatting JSON in EJS

I have a problem with using nodejs and express, I have never used this language and I do not have much knowledge of it so I will try to be as specific as possible here. 1 I have a webservice rest that returns me purchase orders with several i...
asked by 06.01.2017 / 14:47
0
answers

Firebase user update with Node SDK

I'm trying to update login data from a firebase user using the Node sdk admin. My code looks like this: var uid = req.body.uid; var objectUpdate = { "displayName": "David Coelho" }; admin.auth().updateUser(uid, objectUpdate) .then(f...
asked by 03.12.2016 / 19:17
0
answers

node.js unhandled 'error' event

'use strict' const http = require('http'); http.get({ hostname: 'localhost', path: '/user?name=jv&jovem=true&agr=19', port: 3000, agent: false }, function(response) { let body = ""; console.log('STATUS:' + respo...
asked by 04.12.2016 / 19:30
0
answers

Use the same Schema inside a daughter key with Mongoose

I'm working with NodeJS, MongoDB and Mongoose where I'm creating an access permissions system that works with infinite sub-levels. The permissions have the same Schema: //app/models/PermissaoModel.js const mongoose = require('mongoose'); cons...
asked by 17.01.2017 / 17:58
0
answers

How to model a friend system with MongoDB?

I am creating a small social network and I need to create the share of friendships. I have two ideas: A Friendship collection containing the sender, recipient, and response fields and make a populate with mongoose. Put a Friend o...
asked by 19.12.2016 / 19:58
1
answer

Why NodeJS has 4.x, 5.x, 6.x and 0.1x.x versions, etc.

Why Node.js exists in versions 4, 5, and 6, but also exists in 0.x.x versions. Or maybe, what are the differences between x.x and 0.x.x ?     
asked by 10.05.2016 / 03:07
0
answers

Socket.io connects but does not send the emit to the server and vice versa. Nginx and SSL

I'm using Nginx with SSL and this setting for a service to communicate with the node, when I access the address socket.io usually connects to the server but does not receive the emit or send. location ~ ^/(atualizaUltimaPosicao|node|socket\.io...
asked by 14.11.2016 / 12:57
0
answers

How to handle transactions in Node.js?

I'm starting in Node.js and I searched a lot about transaction control , but I did not find anything like what I'm used to in Java. First I'll clarify what I mean by transaction control: Imagine a complex operation where business logic is se...
asked by 04.01.2017 / 23:03
1
answer

Pipe function () javascript (node.js)

How does PIPE () work in javascript (node.js)? I see it a lot in the gulp and would like to know how the function works directly in javascript.     
asked by 05.01.2017 / 22:59