Questions tagged as 'nodejs'

1
answer

Fail to Reconnect Mysql in NodeJS

Good morning I have the following service to manage connections to mysql var mysqlService = require( 'mysql' ); import { config } from '../../config'; var connection; function handleDisconnect() { connection = mysqlService.create...
asked by 11.04.2018 / 11:00
1
answer

Do find using the result of another find (which returns multiple objects)

What I want to do is with the result of a find (which returns several objects to me), again doing a find in DB looking for all the records that have the id of the records that I got in the previous find (taking into account note that they are mu...
asked by 08.03.2018 / 03:58
1
answer

Error in loaders in webpack

I want to set up a project in React from scratch. Launches the following error: ERROR in ./src/js/main.js Module build failed: SyntaxError: Unexpected token (5:4) 3 | 4 | ReactDOM.render( > 5 | <h1>Hello, world!</h1&...
asked by 28.03.2018 / 22:07
1
answer

Uncaught TypeError: AXES is not a constructor

I have my Ejes.js code: const mesh = require('./mesh') const geometry = require('./geometry') function Ejes (dimension) { this.dimension = dimension this.meshesDeEjes = [] } Ejes.prototype.armarEjes = function () { var verticesx =...
asked by 28.03.2018 / 15:39
1
answer

Capture the stdout of a process in a variable

I have the following question as I capture the stdout to use it later (when I match it to data it prints it empty); var exec = require('child_process').exec; var data = "5"; var child = exec('java -jar DproRan.jar', function (error, stdout,...
asked by 31.01.2018 / 20:41
1
answer

How to assign a ssl certificate to an ip of a Droplet in DigitalOcean?

I have a ssl certificate of Let's Encrypt installed on my nginx server and it works fine. And I have my app developed with the MeanStack hosted on a droplet in DigitalOcean with a domain that is jorgecastillodeveloper.pro. when entering link...
asked by 09.04.2018 / 23:21
1
answer

Extract result of a function

Good people, I have this function that I use to analyze some texts, the issue is that I need to include the data in an array, I do this within the function using data, which brings this function, but then the variable 'sentiments' is empty, and...
asked by 09.01.2018 / 16:00
1
answer

Array in nodeJS loses its elements

Good afternoon, I have two array: usersConnected and users . I am working with NodeJS and Socketio developing a chat. To obtain the connected users I create a UID in LocalStorage same that I get through socketio....
asked by 13.12.2017 / 22:57
2
answers

Get res.locals values in another midleware

I am trying to make the page renderize the information of a user that is stored in res.locals , however the router when rendering is in another file, therefore I can not get access to the res.locals information. // root.js...
asked by 26.11.2017 / 22:51
1
answer

Authentication with jsowebtoken

I have an application that in backend works with nodeJS , in the same control or well authenticate process, the problem I have in frontend , I use token to authenticate and in frontend I keep it in the LocalStorage...
asked by 13.10.2017 / 22:23