Questions tagged as 'node.js'

1
answer

Unexpected behavior in asynchronous javascript

I am writing a backend code using javascript, node and the npm modules 'mysql' and 'request'. I tried to write a module to do a pooling of SQL database connections by different API calls in various files of my project. My module mysqlLib.js: v...
asked by 31.03.2017 / 04:48
1
answer

Node js, promises, callback

I need to perform certain updates and delete within a return of a query in my controller. but only the last function is executed I do not think I understand how to use promises. api.adMaster = function (req, res) { var dados = req.bo...
asked by 01.09.2017 / 14:46
1
answer

Heroku - Connetar with mongoDB addon mLab

I need to connect to the Mongo database using the mLO addOn. But I'm not able to insert or list, when running in local mode is working. I have the variable set: Anyideawhatitmightbe?Myapp.jsvarexpress=require('express');varpath=require('path...
asked by 29.10.2016 / 12:45
1
answer

Thumbnails with NodeJS

How can I generate thumbnails of images I get in the base64 format with NodeJS? I currently save only the original but would like to create the thumb of each.     
asked by 18.01.2017 / 12:29
1
answer

Send data to the client without using an additional url

Hello. What I want to know is the best way to send data to the client and this data will be received through a function (which can be executed in a click). In the example below I will render a page (I am using express in node.js): app.get('...
asked by 09.07.2016 / 21:22
1
answer

Get QueryString with NodeJS

I need to get the QueryString being passed to the server created on NodeJS . I've tried it in many ways but I can not get the and ph parameters. I am a beginner in NodeJS and the code I have is: var express = require('express') ,...
asked by 26.11.2016 / 09:20
1
answer

Interface GET and POST Method with Angular + Node.js

I have some beginner's doubts and I wanted to help you. I created a Residential Automation, based on Microcontroller + Node.js + Angular.js. Communication of the Angular.js with the Microcontroller is OK. But I will also do the reverse. In wh...
asked by 04.10.2016 / 15:01
2
answers

Array returning Undefined because of asynchronism

I'm accessing the Trello API , but I came across the following problem: Access the Trello information, obtaining the id of each existing queue, the code is as follows: var x; var numberCardsByList = []; trello.get("/1/boards/[idBoard]/l...
asked by 23.05.2016 / 14:31
1
answer

pass variables to view EJS from different queries

I'm starting with node / express etc. Create a site with the intention of learning and I need help. I have a mysql query that is sent to an EJS view via the code below: app.get('/', function (req, res) { connection.query('SELECT actor_id,...
asked by 14.07.2016 / 07:09
1
answer

Error in FIREBASE + NODEJS: Firebase App named '[DEFAULT]' already exists

I have a CRUD made with NODEJS + EXPRESS using FIREBASE. I add a record normally, but when I add the next, it gives me the error: [DEFAULT]: Firebase: Firebase App named '[DEFAULT]' already exists (app / duplicate-app). If I restart the...
asked by 11.03.2017 / 19:17