Questions tagged as 'nodejs'

1
answer

Send an image using JSON in node.js (express) to an android device

I am trying to send an image to the client using a server in node.js. When I type the URL in a browser I take the image. However, when I want to get it on my cell phone, it does not appear. This is the code to send the url of the image: app...
asked by 09.01.2017 / 21:45
2
answers

How to restart a process with NodeJS?

Currently, I'm doing a code to monitor my files in a given directory and see when changes occur, in order to restart the server, the server is express, and it is running from another file, the server has been a sub -process, this is my code:...
asked by 30.12.2016 / 23:28
1
answer

Problem to access elements of a document: mongoose

I want to do a password verification using express and mongoose. All right until the part where I check the password, I just can not access that value of my document. This is my function: function iniciar_sesion(req, res) { let usu = n...
asked by 26.12.2016 / 21:01
1
answer

Authorize app on GitHub - NodeJS

Good afternoon, I'm trying to authorize my APP in NodeJS to make more than 60 requests to the GitHub API, I managed to do it through the OAuth authorization, which when doing a login sending the client_id the callback returns an acces_token, the...
asked by 13.12.2016 / 21:39
1
answer

Multi Relationships with Mongoose

is the first time I write, I have always solved the problems with questions from others, but this time I have not found a solution for this: I have a Schema where I have several references to other Schemas: var mongoose = require('mongoose'...
asked by 23.01.2017 / 18:21
1
answer

forEach in array array does not work

my code is as follows var array=[[1,2,3],[4,5,6],[7,8,9]]; array.forEach(function(indice){ array[indice].forEach(function(index){ console.log(array[indice][index]); }) }) does not work, why?     
asked by 07.12.2016 / 17:53
1
answer

Do not show information if a url gives 404 NodeJS

Good, there is a way to make if this url where you get the license gives 404 instead of giving errors, directly say no license is found or do not show anything, in the console. getFromGithub: function(allRepos, callback){ var self = t...
asked by 30.11.2016 / 18:10
1
answer

What this error is in NodeJS

I'm new to NodeJS and I have this error. What can you owe? Error: Can't set headers after they are sent. at ServerResponse.OutgoingMessage.setHeader (_http_outgoing.js:356:11) at ServerResponse.header (/Users/santiago/Documents/license...
asked by 01.12.2016 / 17:57
1
answer

this.lastID returns null when I make a bind in the callback of a db.run () - NodeJS

I'm trying to insert a data series into a database SQLite3 from NodeJS by means of a loop with INSERT , however, I need to have the variable I use for the callback function perform the for loop. It occurred to m...
asked by 29.11.2016 / 13:48
1
answer

Sort the values of a JSON file

I have a JSON file, and what I want to do is make a function in which I return an ordered list limited by 10 users (if possible, in an array, but if that is complicated, I would appreciate your suggestion). This data comes from: let points...
asked by 21.12.2016 / 11:52