0
votes
3answers
52 views

How To Remove All Odd Numbers In An Array Using Javascript?

Can someone debug this code? I cannot for the life of me find the (run-time) error: function generate_fibonacci(n1, n2, max, out){ var n = n1+n2; if(n<max){ out.push(n); ...
0
votes
2answers
15 views

Getting current URL from NodeJS's REQUEST module

I'm using nodeJS and the request module. I'm trying to scrape data from a web page, but my data comes from an API which only gives me link-tracking urls. For instance, this link: ...
-1
votes
0answers
26 views

Associative Arrays is empty in node.js

i have a problem with node.js and associative array var getFoo = function(callback) { var arraySegnalatori2= []; arraySegnalatori2["foto"] = new Array(); arraySegnalatori2["foto"][0] = { ...
0
votes
1answer
20 views

In Express and Node.js, is it possible to extend or override methods of the response object?

With every middleware, Express passes a res and a req objects. These objects extend the native ones that come from http.ServerResponse and http.ClientRequest respectively. I'd like to know if it's ...
2
votes
1answer
35 views

Node JS, createServer, and the Event Loop

Behind the scenes in node, how does the http module's createServer method (and its callback) interact with the event loop? Is it possible to build functionality similar to createServer on my own in ...
0
votes
0answers
7 views

How do I include JS files in a Swig template?

I am creating a web application in Node.js, Express 3.0, and Swig (among other things). On one of my templates I want to "include" a JavaScript file. I noticed the feature exists in Jade but could not ...
0
votes
1answer
29 views

Change to don't listen to localhost

When we set up a http server in NodeJS, the default host is localhost:port I'd like to know how to change this path, and put my server to listen to http://myHost without a port. How would I do this? ...
0
votes
0answers
11 views

express.session.MemoryStore not returning session?

It was really easy setting up sessions and using them in php. But my website need to deal with websockets. I am facing problem to set up sessions in node.js. I can easily push data without using ...
0
votes
0answers
19 views

I can't change maxSockets Value [Nodejs]

I am using this code but still have 5 connections limit.How can I increase it ? I searched all over internet and could not find any solution. Ps:I don't want use websockets,because it is blocking by ...
3
votes
3answers
62 views

Javascript: DFS traversal of a directed tree with I/O involved

Given a directed tree T with a variable number of children per node, I would like to find a path the size of PATH_SIZE of "good" nodes starting from root. every node has an isGood() method and a ...
0
votes
1answer
18 views

Letting HTML forms make use of JSON APIs

So, I've spent a lot of time writing a cool RESTful API. To simplify, one can create a new user by performing a POST request to /users. Great, huh? But now my HTML form wants to create a user. All of ...
0
votes
1answer
26 views

Getting an object from MongoDB using its id

Let me explain my problem first. I am trying to get the ID from URL and use it to find a record in the database(MongoDB). The following code I have in NodeJS Express App. ...
0
votes
1answer
30 views

express - Use variable from controller in <script> tag [duplicate]

When rendering a view with node/express I pass a locals object which holds different information for the view. else { res.render('transactions', locals); } I got an Array in locals.tags which ...
0
votes
1answer
17 views

How to set more than one cookie in nodejs?

This is how I set one cookie, but how to set two or more? var head = {}; head['Set-Cookie'] = name+'='+value res.writeHead(200, head);
0
votes
2answers
25 views

How to use aggregate functions using node-js

I have a json which has the array called as chargeamountunitLevel. I want to sum-up the chargeAmount by grouping by the chargeAmountUnit.The Input json: "chargeamountunitLevel": [ { ...

1 2 3 4 5 522
15 30 50 per page