Questions tagged as 'nodejs'

1
answer

Delete productId with Nodejs & Mongodb

Good! I am developing a mini API RESTFul with Node.js and Mongodb . The question is this, I am developing 4 basic functions for my API that would be GET, POST, UPDATE, DELETE . I'm having an error when performing...
asked by 25.04.2017 / 17:32
1
answer

Database with socket.io and node.js

I am trying to create an application of the type messenger. I connect to the database using node.js mysql. Each person who logs on the website is initially connected to a room for example: "room juan" (only John connects to this room) said room...
asked by 18.02.2017 / 15:25
1
answer

Problem with a NodeJS and MongoDB connection with Mongoose

I am trying to create a connection between mongodb and nodejs, my code is as follows: const express = require('express'); const bodyParser = require('body-parser'); const pug = require('pug'); var app = express(); var mongoose = require('mongo...
asked by 12.06.2017 / 07:09
1
answer

How to return variable in nodejs

I have this function: I do not know how to return. var getVariablesOriginales=function(nombre){ var objBD = BD(); let res=[]; objBD.query("select ID_U from usuario u where u.'NOMBRE'=?",[nombre], function(err, rows, fields) {...
asked by 28.01.2017 / 16:29
1
answer

Hello world with MongoDB!

Objective: make a hello world with MongoDB in Node.js, which consists of saving an email and password in a BD called mi_bd. Problem: I have a form with two input text for the email and user, and when I submit, the browser returns The dat...
asked by 03.02.2017 / 05:13
1
answer

Persistence of "fs.watch"

I work in NodeJS , an acquaintance recommended me to do a watchdog (supervision) in which when a command is modified, it would be automatically reloaded (after being saved ). In the documentation of NodeJS I found the following: link...
asked by 02.01.2017 / 16:57
1
answer

how to pass variable from nodejs (Expressjs) to javascript (client side)

I have this fragment of code in nodejs app.get('/consul', function(req, res, next) { // res.render('c_pUser', { title: conUsers}); }); the title variable I want to pass it to javascript on the client side try to show it in javasc...
asked by 04.12.2016 / 14:17
1
answer

Nodejs Proxy coming out with connection from another computer

I have a script in NodeJS that connects to an HTTPS API, but the server where the script is located is behind a proxy that does not allow HTTPS output. My query is: How can I make a script so that it uses the internet output of another co...
asked by 23.12.2016 / 14:02
1
answer

Error when running micro -p 5000 pictures.js

When I execute the command: micro -p 5000 pictures.js I get the following error ...    import {send, json} from 'micro' ^^^^^^ SyntaxError: Unexpected   import token       (Note: micro ":" ^ 6.0.2 ", node: v6.9.1) How can I so...
asked by 01.11.2016 / 23:54
1
answer

Create a shortcut that executes a file in Node.js

I have a program made in Node.js that is on the route: D:\Dropbox\js-arduino\LEDJavascript\index.js Obviously I run it from the terminal as follows: node index.js Is there a way to create a script that just by double clicking, start ru...
asked by 07.11.2016 / 22:51