Questions tagged as 'nodejs'

2
answers

Add a non-existent item to a JSON from js

I've tried with: var data = {}; var file = {file:{name: 'Getter - Blood.mp3', path: '/user1'}}; data.push(file); //Y tambien asi data.file = file; But nothing works, no error or anything, but when you print it on the screen, the new items d...
asked by 23.06.2016 / 19:40
1
answer

Create service that runs npm start

Hello friends of the community. I have a project made node.js in react and express and I want to deploy it in a virtual machine with ubuntu 16.04 creating a service that runs npm start . On my pc I run the project with npm start which i...
asked by 08.11.2018 / 01:38
1
answer

Get value of a Json in node.js [closed]

I find myself stuck and I hope you can help me. I have an API where I make my requests (Post, Get, Delete, etc.) In this function I do a post sending a json, the answer is another json, as seen below. With that all goes well, h...
asked by 01.10.2018 / 21:18
1
answer

Error when displaying Firebase + Vuejs + ElectronJs data

I can not see data with electronJs and Vuejs from Firebase. let usuarios = mdb.ref("usuarios"); var vm = this; var user = firebase.auth().currentUser; var userid = ""; firebase.auth().onAuthStateChanged(function (user) { if (user) {...
asked by 02.10.2018 / 01:21
2
answers

How to get server time with node.js

The way I do it with javascript on the client side is the following function srvTime(){ try { xmlHttp = new XMLHttpRequest(); } catch (err1) { //IE try { xmlHttp = new ActiveXObject('Msxm...
asked by 22.09.2018 / 01:38
1
answer

ERR_HTTP_HEADERS_SENT - Json Web Tokens in Node.js

I'm trying to implement the JSON TOKEN in node.js but I have this error:    [ERR_HTTP_HEADERS_SENT]: Can not set headers after they are sent to the client at ServerResponse.setHeader (_http_outgoing.js: 469: 11) This is the code I have:...
asked by 18.09.2018 / 00:25
1
answer

Cast to ObjectId failed for value \ "private \" at path \ "_id \" for model \ "Product \"

Hi, I'm doing an API Rest with Nodejs and MongoDB and I have the following problem: { "message": "Error al realizar la petición: CastError: Cast to ObjectId failed for value \"private\" at path \"_id\" for model \"Product\""} I do not unde...
asked by 18.08.2018 / 11:44
1
answer

console.log with values and return undefined

var got = require('got') exports.coger = function (id){ let i; if (!id){ i = "Introduzca una id"; return i; } got('enlace privado').then(f => { let a = JSON.parse(f.body) console.log(a) if(a.error){ i = a.error...
asked by 13.08.2018 / 12:26
1
answer

How to use Node.js in asp.net MVC using Visual Studio?

I currently have a project created asp.net MVC in C # and I wanted to add code from Node.js. Download the Node.js from the package nuget and install it by creating a .bin folder containing node.cmd in the project I have the following code...
asked by 10.09.2018 / 20:36
1
answer

How to create the production file in react with webpack

I have a simple crud that I did in react, the issue is that I did not use the create-react-app tool, but that I did it from scratch with webpack and babel, etc. My problem is how to create the production folder since with webpack it only does...
asked by 13.09.2018 / 22:13