Tagged Questions
0
votes
0answers
20 views
Simple TCP Server
Context:- I am trying to create simple TCP Server in Node.js
Problem Statement:- I am getting an error Unexpected Token '{' given below
Attach Code:-
var net = require('net');
var server = ...
-1
votes
0answers
25 views
How do I create a Server-Side JavaScript website? [duplicate]
So I've been trying to create a Server-Side JavaScript website and I am using Digital Ocean with an Ubuntu 14.04 x64 Droplet, I am about to install the Node.js thing on my droplet but I have not found ...
0
votes
0answers
53 views
run websocket-rails javascript client in node.js
I'm trying to retrieve data from a websocket using my own web server. The websocket server on the remote host runs websocket-rails. From the Websocket-rails github project page ...
0
votes
0answers
19 views
NodeJs + RequireJS serverside.Application doesn't even start
OK. Scenario
My main file
var APPROOT= __dirname;
var requirejs = require('requirejs');
requirejs.config({
nodeRequire: require,
nodeIdCompat: true,
baseUrl: APPROOT,
paths: {
...
0
votes
1answer
66 views
Nodejs “net” - How to send messages from server in Unicode instead of ASCII?
I am making a chat application and I can manage to send messages in Unicode from the clients, but if I write an instruction in the server code (nodejs script with net framework), for example attaching ...
0
votes
0answers
30 views
NodeJS as javascript server pages
What setup should i use to have a bunch of HTML (*.html) files - some of them having server side code (<?= 'Hello world'?>) - acting as javascript server pages on a node.js server?
1
vote
4answers
1k views
how to fix UNMET DEPENDENCY errors on expressJS
I'm getting started with express JS and NodeJs
using the
ExpressJSGuide
I'm stuck at the
npm ls
part, it throws the following errors
└─┬ [email protected]
├── UNMET DEPENDENCY buffer-crc32 ...
1
vote
0answers
113 views
mongoose saving referenced nested Objects
I have a Schema which references other Schemes:
var tripSchema = new Schema({
startTime: {type: Date},
endTime: {type: Date},
trackEntries: [{type: ObjectId, ref: 'subSchema1 '}],
...
1
vote
0answers
26 views
Roundtrip processing and update not occuring in Express.js with Html page and node.js server
I have written this code to get updated values from my external json file, in app.js file of Express.js.
But i am not able to get updated values on my client side
setInterval(function(){
var fs = ...
0
votes
0answers
70 views
hogan server side compile - save to single file
I would like to compile hogan templates and store the compiled code in the same .js file
I am currently doing this
hulk ~/path/to/templates/*.hogan -o ~/path/to/output/dir
If the contents of ...
0
votes
1answer
67 views
which errors must be handled in nodejs?
Irrespective of any business logic, what errors must be handled in node server. ?
What are potential errors/exceptions ?
I have tried to take care of following things-
uncaughtException
socket ...
0
votes
0answers
219 views
Rendering a single page application with data from the POST request to the server, in NodeJS/Express
I have a single page application which is pretty simple and basically starts out as a blank page. This app is designated to be a Facebook app - running in the Facebook Canvas.
Facebook loads my app ...
2
votes
1answer
174 views
Netscape server-side scripting (SSJS)
What is differences between Netscape server-side scripting (SSJS) and node.js implementation?
Why Netscape's implementation did not gain so attention while node.js seems to be popular?
26
votes
5answers
13k views
nodejs vs node on ubuntu 12.04
I installed nodejs on ubuntu from instructions given here
When I write node --version in the terminal I see this :
-bash: /usr/sbin/node: No such file or directory
I can see node in the /usr/sbin/ ...
0
votes
1answer
295 views
Nodejs mysql module not connecting to database
I'm trying to do a simple test query to get the node mysql module working but it's not connecting to the database.
Here's my code in app.js:
var http = require('http'),
io = ...
1
vote
1answer
1k views
How to access mysql database with socket.io
I'm just getting into coding server side javascript and have been reading tutorials on socket.io and node.js, but I haven't come across anything demonstrating how to use node.js to access a mysql ...
2
votes
2answers
3k views
Which's the best DB(NoSQL or regular SQL) to choose using Node.js? [closed]
I've read that there are more information about using MongoDB with Node.js rather than MySQL and that is a concern for me, because I'm used to work with MySQL. In terms of development and performance ...
2
votes
1answer
3k views
how to detect that user's connection is lost or he closed the browser window in Nodejs socket.io
I have a chat application on Node.js and Socket.io, user can connect and disconnect with a button...
I am having a list of online users which is perfectly managed with the help of my defined events ...
0
votes
1answer
335 views
How to secure socket.io from code injection?
So i'm developing a socket.io real-time web-app.
The first concern of mine was "What if some evil-minded user tries to inject some code via Dev Tools or Firebug?" and i've got my answer here on SO. My ...
0
votes
1answer
994 views
How to write test driven programming in node.js?
Recently I got introduced to node.js and packages like express, mongodb and ejs. I have few questions :
As a learning purpose, I have created a github repo of user management which uses express, ...
0
votes
1answer
324 views
Using custom fabric.js classes in node.js
I'm using a couple of custom fabric.js classes in my app to render and encapsulate some additional data attributes as suggested here.
Now that I have the JSON data generated by these, I'd like to ...
0
votes
2answers
58 views
Weird scope behavior in node or am I sleeping?
My js is as follows,
/*
* GET home page.
*/
var MongoClient = require('mongodb');
exports.index = function(req, res){
var studentObj = {};
...
4
votes
3answers
1k views
Are there any ports or alternative implementations of the node.js platform with JavaScript engines other than V8?
node.js is an open source server-side JavaScript platform based on Google's V8 JavaScript engine. It has been rapidly gaining popularity and importance for couple of years now.
Now node.js is just a ...
0
votes
4answers
351 views
How to fetch a site name from URL in Javascript?
Is there an easy way to fetch a site name from a URL string?
Example:
http://www.mysite.com/mypath/mypage -> www.mysite.com
http://mysite.com/mypath/mypage -> mysite.com
The JS code is ...
1
vote
1answer
223 views
How does Node.js handle connections?
I'd like to know how does Node handle connections. I mean: when I run...
node myserver.js
... and I make a request, what does Node do?
I've made a test. I have a server running with socket.io. I ...
1
vote
1answer
1k views
node.js: Accessing local variables from another module
My Problem
I'm writing a node module called a, which require()s a module b (written by a stranger). Unfortunately, a doesn't only need to access the public members - it also needs to access local ...
0
votes
2answers
274 views
Middle layer between MongoDB and PHP and mobile aps
We plan web project (accounting software) using PHP for web frontend and MongoDB as database. Also, there will be probably mobile aps for iPhone and Android, possible REST API and more. We need to ...
7
votes
2answers
3k views
How to debug and log own code on the server side of Meteor?
Never mind. The reason this did not work: I forgot to meteor reset so debugger did not get a chance to stop. Duh!
More info: I am using the method in the answer by Mason Chang to the related ...
2
votes
2answers
2k views
NodeJS 'assert' test fails for json object returned through the express http response
Having recently developed an interest in NodeJS, I finally managed to get my hands on a NodeJS book. A simple example on the book was to create an express server and write a test to verify a simple ...
5
votes
1answer
659 views
Retrofitting an existing Backbone app for server-side rendering with node.js?
I have a web app whose current structure is to render everything in the browser with backbone.js and client-side templates, pulling all dynamic content from a Python-powered JSON API. Some of the app ...
3
votes
2answers
901 views
Node.js and Redis
I am trying to link up a redis database with a Node.js application I am building to be able to store comments about items. I'm using the node_redis library to handle the connection. When I attempt to ...
0
votes
1answer
241 views
Calling server side javascript from the browser through internet
can anybody help me to call a server side javascript method from the client HTML page (browser) and get back the object from the server and process through internet.
as like google maps api.
ex as ...
12
votes
1answer
6k views
What is non-blocking or asynchronous I/O in Node.js?
In the context of Server Side Javascript engines, what is non-blocking I/O or asynchronous I/O? I see this being mentioned as an advantage over Java server side implementations.
1
vote
2answers
514 views
Is there a good server side javascript based rest API testing framework? [closed]
I would like to test the external endpoints of a rest api written in java but I would like to run tests from javascript for the possibility of sharing js code and maybe the testing framework with our ...
9
votes
1answer
4k views
What is the correct way to chain async calls in javascript?
I'm trying to find the best way to create async calls when each call depends on the prior call to have completed. At the moment I'm chaining the methods by recursively calling a defined process ...
1
vote
1answer
3k views
“Error: write EPIPE” with Socket.io on node.js
I manually applied this patch and everything works now. Waiting on upstream to fix this
https://github.com/LearnBoost/socket.io-client/pull/361/files
I'm just trying to follow the examples given ...
3
votes
1answer
236 views
Server side javascript - General [duplicate]
Possible Duplicate:
What is node.js?
Usages of Node.js - What obstacles is it aiming to provide a ramp for?
What is the correct scenario to use server side javascript? like node.js
What ...
0
votes
5answers
351 views
How long does it take to create a module / library in JavaScript for Node.js? [closed]
I have yet to learn a programming language, and I have to choose between Python and JaveScript for my project.
With Python, I know, most of the libraries are already there for me, quite ready to use. ...
0
votes
1answer
243 views
Web Frameworks & Available Libraries: Is it a brave move to opt for Node.js instead of Python?
I have quite sometime now (a month or two) before I can actually start learning a web programming language; so I am still worrying about what language to learn.
Whatever programming language I ...
8
votes
5answers
2k views
Is there a way to test circular reference in JavaScript?
I'm making a game, and I've come across a problem... When I try to save, JSON fails and reports that circular reference is being made somewhere. I don't think it actually is, I can't see it, so is ...
1
vote
1answer
981 views
from node.js server side: photo upload to facebook
According to facebook documentation, http://developers.facebook.com/docs/reference/api/album/, to upload a photo, source type should be "multipart/form-data"
Now I got the image file from client to ...
21
votes
5answers
21k views
How do I parse a HTML page with Node.js
I need to parse (server side) big amounts of HTML pages.
We all agree that regexp is not the way to go here.
It seems to me that javascript is the native way of parsing a HTML page, but that ...
266
votes
9answers
76k views
Node.js Best Practice Exception Handling
I just started trying out node.js a few days ago. I've realized that the Node is terminated whenever I have an unhandled exception in my program. This is different than the normal server container ...
1
vote
1answer
510 views
Using OpenID with server-side JavaScript (node.js), but I get an error
Using the code from this example, I open the browser, type "localhost/" and I get the page with that login form. I type the URL to my blogspot, but I get the following error: error:Invalid ...
0
votes
4answers
1k views
call nodejs scripts from html pages
I would like to call node.js scripts like i do with php, that is simply using their url.
I'm mainly a js programmer, so it would be wonderful for me to ditch out php totally and use node for the ...
2
votes
1answer
875 views
How to structure Models and Views in NodeJS?
I am writing a NodeJS based server- and client-side JavaScript application. I have Controllers, Models, Views and Presenters. The problem I am facing is that some parts of the code need to be only ...
4
votes
3answers
8k views
How to convert character encoding from CP932 to UTF-8 in nodejs javascript, using the nodejs-iconv module (or other solution)
I'm attempting to convert a string from CP932 (aka Windows-31J) to utf8 in javascript. Basically I'm crawling a site that ignores the utf-8 request in the request header and returns cp932 encoded ...
6
votes
2answers
578 views
JavaScript callbacks and functional programming
"Functional programming describes only the operations to be performed on the inputs to the programs, without use of temporary variables to store intermediate results."
The question is how to apply ...
18
votes
11answers
3k views
JavaScript pass scope to another function
Is it possible to somehow pass the scope of a function to another?
For example,
function a(){
var x = 5;
var obj = {..};
b(<my-scope>);
}
function b(){
//access x or obj....
}
I ...
0
votes
1answer
638 views
Node.js Remote File Upload/POST/Write
Hi
Sorry for the messy code: we're at a hackathon, and time's running out.
We're trying to connect to the Google PersonFinder API, but having trouble.
You create an XML file and upload it to the ...