Questions tagged as 'nodejs'

1
answer

Pass additional variables to Passport-Twitter

I need to pass an additional variable to the login with Twitter of passport , it would be something like this: app.get('/twitter', function (req, res) { var variableallegar = req.query.idunico; }, passport.authentication('...
asked by 12.10.2016 / 17:21
4
answers

Can you pass content from a .txt file to JSON?

I have several .txt files equal to this content Content: 0 69 164 0 71 117 0 73 84 0 79 80 0 82 83 0 82 115 0 83 154 0 84 48 1 69 104 1 71 100 1 73 83 1 79 82 1 82 121 1 83 117 1 84 46 2 69 204 2 71 94 2 73 85 2 79 102 2 82 88 2 82 147 2 83...
asked by 17.10.2016 / 03:51
2
answers

Update nodeJS file without stopping restart

Will there be a way to update a file and see the changes in real time? example    I have a file server.js and I modify it. How do I see the result without stopping the service and restart it with node server.js ?     
asked by 16.02.2018 / 01:03
2
answers

Call my NPM package (Node module) without adding the .js

Hi, I'm programming a module for nodejs that is installed through npm , everything works great, the code, the installation, everything as it has to be etc ..., my concern is that to use other modules it is not necessary to add the...
asked by 24.11.2016 / 23:14
1
answer

why assign the same name to both a variable and a function?

const Hola = function Hola() { _classCallCheck(this, Hola); };     
asked by 27.01.2018 / 09:26
2
answers

Browse JSON JavaScript NodeJS

Good morning, I modify the question. How can I navigate through this JSON in NODEJS JavaScript: { "subscriptionId" : "5a268a598dc68904bbc7b3cf", "originator" : "localhost", "contextResponses" : [ { "contextElement" : {...
asked by 05.12.2017 / 13:48
2
answers

error running server.js Node js

Hello, I'm doing a Node JS application and you let me know this error because if I have the JS, npm and express node installed correctly? root@sommer-AO532h:/home/sommer/Desktop/aplicacionnode/express_example# DEBUG=express_example:* npm...
asked by 08.06.2017 / 09:22
1
answer

Nodejs: Can not set headers after they are sent

Good I have an error in Node that I do not understand because it happens: class HomeController { getViewLogin(req, res, next) { if(req.isAuthenticated()) res.redirect('/index'); res.render('singIn', { title: 'Login'...
asked by 13.03.2017 / 17:26
2
answers

Count items in JSON

What would be the way to count the items of a json response with this structure: [['dato', 'dato', 'dato'], ['dato', 'dato', 'dato']] and so on. I know that using this function count = Object.keys(res).length; you can count...
asked by 07.12.2016 / 20:58
1
answer

How to perform an update with mongoose and nodejs?

I have the following code for an update, the problem is that I do not know if more than one field can be updated and if so, how would it be? Boleta.update({serie: serie}, {firma: parametros}, function (err, firma){ if (err) {...
asked by 02.02.2017 / 23:50