Node.js is an event-based, asynchronous I/O framework that uses Google's V8 JavaScript engine. Node.js is commonly used for heavy client-server JavaScript applications.
0
votes
0answers
5 views
Is there any relation between deprecated express.createServer() issue and mysql connection from node js?
The issue 'deprecated express.createServer()' has been overcome by replacing the code
var app = express.createServer() with var app = express(). After this change, i got the another error at ...
0
votes
0answers
13 views
Odd node.js behavior with Google Api
I am writing a small node.js web application that requires the Google API and uses OAuth2 as the authentication mechanism. I noticed something peculiar when requesting the access tokens - the "code" ...
0
votes
1answer
15 views
calling child_process from nodejs
I'm having an html file with a hyperlink which calls javascript function.The javascript function has to call a batch file...this all should happen from Node.js
<html>
<head>
...
0
votes
0answers
9 views
Get response status 404 in casper.js within Open
Any idea why code below doesn't catch 404 in either response var or in the http.status.404 event?
var casper = require("casper").create(),
utils = require('utils');
casper.start();
...
0
votes
0answers
4 views
Multiple new filenames with jquery-file-upload-middleware
I'm having an issue with allowing users to specify new file names when uploading multiple files. On the client side I know that I'm sending a new unique file name with each post of a file upload. It ...
0
votes
0answers
8 views
MongoDB (Node JS), how to correctly add calculated fields to a query result, where the calculated field uses a passed variable
I have a collection with feeds. The documents are structured something like this:
{
_id: '123',
title: 'my title',
openedBy: ['321', '432', '543'] // ID of users
}
Then I have users:
{
_id ...
-1
votes
0answers
15 views
front-end side javascript http get request to node express app
Hi everyone I am a newbie to express and I have written following code in the server side.
var express = require('express');
var app = express();
var a;
app.use(express.bodyParser());
...
-2
votes
1answer
27 views
NodeJs port only works via local network
I set up a simple NodeJs server:
var express = require('express');
var app = express();
app.get('/', function(req, res){
res.send('hello world'); // try res.json() if getList() returns an ...
0
votes
0answers
11 views
Datatable plugin not working in node.js
<script>
jQuery(function($){
function implementHover(){
$('#SiddharthTable tr').hover(function(){
$(this).toggleClass("highlightTheRow");
});
...
0
votes
2answers
23 views
What is the Windows command prompt equivalent for th unix command 'ls -lah'?
I am beginning to learn node.js. I started by reading the book "The Node Beginner" and the code given there seems to be written for running in unix, and I don't know how to write equivalent code for ...
0
votes
0answers
5 views
Mails for verification using Nodemailer
I want to use node-mailer module to send emails to registering users on app for verification and other purposes also. I am not sure which transport mechanism to use so that emails I send are not a ...
0
votes
0answers
7 views
running restler on Virtual Machine always returns [Error: connect ECONNREFUSED …]
I am very new to node.js and javascript in general. I am running Ubuntu 12.0.4 LTS ( Precise Pangolin) on VMWare Workstation 9 ( for non-commercial use ) to learn node and familiarize myself with a ...
-1
votes
0answers
12 views
nodejs : how to use feedparser
I'm trying to use feedparser (https://github.com/danmactough/node-feedparser) for parsing out all the wikipedia links from ...
0
votes
0answers
9 views
Save and reference multiple models with mongoose
Let's say I have three schemas that look like this:
var schema1 = new Schema({
//some attributes here
name: String,
schema2s: [{type: ObjectId, ref: 'Schema2'}],
schema3s: [{type: ...
0
votes
1answer
10 views
Using NodeJS to send an mongodb data through to Jade
Im currently using nodejs, express, jade and mongodb to create a website. Its been going well so far however im currently trying to place a small box on the side of every page on the site that ...
0
votes
1answer
36 views
Node JS and ajax problems
I am trying to receive data through ajax from node.js but I am not sure what I am doing wrong between interacting the two.
Here is my ajax get request:
$.get('/notificationsNumber',
...
0
votes
0answers
23 views
socket.io broadcasts everything to everybody in node/express app
I wondered if someone could help figure out what I am doing wrong:
My client web page initiates a connection with my server. I define a socket.io connection in the app.post() method. However, when a ...
0
votes
1answer
16 views
Angular JS tutorial bootstrapping 2
I am just following the tutorial listed on Angular JS, I am using Windows platform. I am on the bootstrapping page, I am stuck at app running; I have installed node JS and downloaded GitBash; when I ...
2
votes
1answer
23 views
Nodejs: want to map domains to server
I have a webapp where I allow people to create sub-sites on my app server (ex:mysite.com/their-site). I want them to be able to point their domain to the sub-site on my app. Similar to how you attach ...
3
votes
0answers
30 views
Way to stop ASI on node.js and have it err?
I know automatic semi-colon injection is a contentious issue but I would prefer if I could disable it on my node.js based server.
Script:
var foo = bar()
var baz = foo+1;
With result:
[Error] ...
0
votes
1answer
12 views
What does this mean? node.js this.queue(String(Number(msg) ^ 1));
I'm investigating substack/shoe example code, especially node stream out out on browser side:
https://github.com/substack/shoe/blob/master/example/invert/client.js
stream.pipe(through(function (msg) ...
0
votes
1answer
15 views
jekyll serve (locally) without building
Jekyll generates a static site in a given directory (by default, _site). Running jekyll serve builds the site and then sets up a server such that the site can be viewed locally on the specified port ...
0
votes
1answer
16 views
Grunt Globbing patterns
What is the pattern needed to achieve the following.
Match all the html file in the directory .tmp
Match all the html file in .tmp/views and all subdirectories of it (recursively to any depth)
...
-3
votes
0answers
15 views
how run server coffeescript in background?
I have a server(app.coffee) and I want run it in remote server in background. But when I close console not working. I tested with forever (forever start -c coffee app.coffee), nohup and nodemon (nohup ...
0
votes
0answers
14 views
Authentication mechanisms for a AngularJS/NodeJS/RESTEasy+JBoss/LDAP stack
I'm looking for some authentication/security mechanisms or best practices on an application stack set up like this:
AngularJS front-end
NodeJS web server
RESTEasy backend running on JBoss AS 7
LDAP ...
0
votes
0answers
15 views
Node.js - Module Version Mismatch on Linode Server
I am trying to deploy a node app on Linode (Ubuntu 12.04) while following this guide from Node Knockout: http://blog.nodeknockout.com/post/9300619913/countdown-to-ko-14-deploying-your-node-js-app-to
...
0
votes
1answer
22 views
io.connect not working on local html page
I have an html page that needs to connect to a node.js server via socket.
The code works when in an html page that's hosted on my EC2 however, it's not working when I have it on an HTML page on my ...
0
votes
1answer
14 views
nodejs's lazy.lines.forEach not forEaching over aws cli tool output
if anyone out there is trying to use amazon's AWS api with nodejs like me can you please enlighten as to why...
child = exec("ssh root\@<server> \"/usr/bin/aws ec2 describe-instances --output ...
1
vote
1answer
26 views
What's the closest Node.js equivalent to Rakefiles?
I'd like to switch from Makefiles to something more Node-idiomatic, but npm run-scripts can't depend on each other, and grunt makes it incredibly overcomplicated to construct shell tasks.
Is there ...
0
votes
1answer
12 views
Render view into a variable in ExpressJS (for AJAX response)
I want to load the contents of a partial view (written in Jade) into a Bootstrap modal dialog. For this, I use an AJAX call. I could return only the generated HTML and load it into the modal, but ...
-2
votes
1answer
21 views
“The installer has encountered an unexpected error installing this package…”. Is it possible to install Node.js (v0.10.15) on Windows XP?
I want to use Node.js under Windows XP. I've downloaded the node-v0.10.15-x86.msi installer but when I try to install Node.js I always get this error at the middle of the process:
The installer ...
1
vote
1answer
30 views
SEC7111: HTTPS security is compromised using IE9 and Socket.IO
I'm using Socket.IO for a NodeJS web application. The page is served on SSL and my connection looks like this:
var socket = io.connect('/');
This works on pretty much any browser except IE9. On IE9 ...
0
votes
1answer
34 views
how to join the result of two node-mysql.js functions in express.js
I'm trying to export some legacy data from a mysql db as JSON using express and node-mysql. The SQL below works fine. I'm struggling with a simple way to join the 'result' of getOwnerID and to the ...
0
votes
0answers
12 views
Regarding storing complex datas, and retreiving complex datas using node.js and mongodb
I am trying to store a task into mongodb such as simple adding like 1+1, or a list of questions, but so far I only got to store simple data such as a string, I have some idea regarding how database ...
0
votes
1answer
24 views
MYSQL Select, get rid of column name
I have returned a column of my mysql server(nevermind that they're all the same number...this is jut for testing purposes)
I want all of the numbers in an array...JUST the numbers, not the name of ...
0
votes
2answers
17 views
Node.js response.end([data], [encoding]) method
The documentation for the method writes,
"If data is specified, it is equivalent to calling response.write(data, encoding) followed by response.end()."
And the doc describes the ...
0
votes
0answers
17 views
How to use forever-node with sudo command?
I have a server of flash-cross-domain-policy wrote in Java script node.js:
var net = require("net");
var flashPolicyServer = net.createServer(function (stream) {
stream.setTimeout(0);
...
0
votes
0answers
13 views
Accessing a public calendar using Google API without requiring a user to log in
I'd like to access a public calendar using Google's REST API.
Google's calendar API suggests I need an OAuth token to get access to calendars:
https://developers.google.com/google-apps/calendar/auth
...
4
votes
0answers
47 views
Load test a Backbone App
I've got an NGinx/Node/Express3/Socket.io/Redis/Backbone/Backbone.Marionette app that proxies requests to a PHP/MySQL REST API. I need to load test the entire stack as a whole.
My app takes advantage ...
1
vote
1answer
33 views
Javascript object comparison recursion broken
So it seems I've been scratching my head over this for the past few hours.. roughly around 6 hours now and I just can't seem to figure it out. I have looked at various questions/answers on SO but none ...
-2
votes
0answers
22 views
How to get data from php JSON in node.js [duplicate]
There is a file / json.php with content: header ('Content-Type: application / json'); echo json_encode ($ user); How can I get the content in node.js?
0
votes
1answer
20 views
Mongoose validation only when changed
I want to validate a users email address, but only when it is changed. The following code seems to vlaidate everytime I make a save to any Entrant, and therefore is throwing an error that the email is ...
0
votes
1answer
23 views
Sending HTTP response in node.js
I am trying to send an http response in node to print results in the browser. The simplified source code is down below. Basically, all the variables are defined somewhere in the program, so that ...
0
votes
1answer
16 views
commander.js - .prompt removed, now what?
In commander.js, when asking for user input, I would use the prompt method:
program.prompt('name: ', function(name){
console.log('hi %s', name);
});
But now that method has been removed in ...
1
vote
1answer
26 views
Inheritance in Node.JS
I am using node.js and programming based on express.js. I have tried to use util.inherits to implement inheritance in JavaScript. What I've tried is as follows:
//request.js
function Request() {
...
0
votes
0answers
13 views
Node.js producer consumer with aws S3
I have a producer/consumer problem that I need to solve with Node.js. The background is that I have a web service that takes a stream of data representing a file and needs to upload it to amazon's S3. ...
0
votes
0answers
27 views
need some guidance on how to rearrange my event listener, functions and api calls
I want to use the res() to send a response back from my search api call, I'm taking a value in as a post, storing that into an array and running a function on that value, wait for it to be complete, ...
0
votes
0answers
15 views
Require client authorization for Socket IO
I want that some methods called from socket.io server to require authentication.
The first solution is to check for authorization during the handshake process.
The second solution is to check for ...
0
votes
0answers
21 views
How do we create a Schema at runtime in Mongoose ODM?
It's my understanding that Mongoose Schema's are defined at some point in the initiating stages of a Node app. These will obviously be hard coded, like so:
var SomeSchema = new Schema({
...
-1
votes
1answer
13 views
JSDoc without Java?
I'm trying to incorporate JSDoc into my Grunt deployment process. When I run it, I get the following error (expectedly):
>> JAVA_HOME is not set. Jsdoc requires Java to run.
Fatal error: Bad ...