« first day (54 days earlier)      last day (23 days later) » 

12:02 AM
0
Q: Rendering images using NodeJS

user3822428I am developing a web application using Node JS and Socket.IO. Here when I click a button a text in displayed in the browser using sockets so if I open a new window with the browser I can see a text. What I am trying to do is to render some images on my site but I cant find a way of make it work...

0
Q: MongoDB: How do I search multiple collections within same database and return mixed result set?

Morris A. SingerI have a single-page application that is feeding on an API I wrote in JavasScript running on Node.js and using MongoDB for data storage. The API exposes several different content types, each of which is stored in a separate collection in my MongoDB database. My single-page application has a searc...

 
12:47 AM
0
Q: PHP vs NODEJS vs Others as a API client

domI've been searching for days but I cannot find an answer. I want to build an API client that sends our restful API calls and logs them into a NoSQL database (Cassandra). It must also use a SQL database for User information etc. Very similar to what https://segment.io/ does (They use ExpressJS). ...

0
Q: How to run Socket.IO application on my Server

vbotioI'm studying how to build a simple application of a real-time chat. I found many solutions using Socket.Io and it's working perfectly on localhost, but I have no idea how to make it work on my server. Any suggestions ? Here is my codes. INDEX.JS ar app = require('http').createServer(handler); ...

 
1:37 AM
0
Q: is it possible to debug node repl

cooolIs is it possible debug NODE REPL. node cmd bring the repl prompt >. within the prompt is it possible to start the debugger. say for eg > hello = function(){ ....debugger; ....console.log('hello'); } >hello() --> should run in the debugger..

-2
Q: What language/platform is good for writing server code that changes depending on the time?

TDashEssentially, what I want to write is a server engine/backend for a game that is dependent on events (ie. the day changes, state changes). What platform can I write this in that will be able to run all the time, listen for events like this, and be able to update the database? I have experience in...

0
Q: is there a way to debug in node vm

cooolHow to call debug when loading a module in VM. can putting a debugger statement would start the node debug/is there an option for starting the debugger in node vm statement. vm.runInThisContext codeToBeRun

 
2:00 AM
0
Q: Is verifying whether a user is an admin based on req.user secure?

LuxelinI am using a simple middleware function in my express.js app to verify whether a user has admin privileges: function isAdmin (req, res, next) { if (req.user.admin) return next(); res.redirect("/"); } passport is being used for account authentication. Is this secure or can req....

0
Q: Error in installing Phonegap on Windows 8.1

WilliamWallaceWhen installing phonegap on my computer, I receive this error message. I have no idea how to fix it. C:\Users\Scott>npm install -g phonegap npm ERR! network connect ETIMEDOUT npm ERR! network This is most likely not a problem with npm itself npm ERR! network and is related to network conne...

 
2:28 AM
0
Q: Node.js use installed package in public/javascripts file

ShazamI have installed a package using 'npm install package-name' and now I am wondering how I can use this package in my global.js file which is in the public/javascripts folder? I have tried using 'var name = require('package-name');' in the global.js file however this does not seem to be working. A...

 
2:52 AM
0
Q: Restart a node.js app from code level

BernhardI've an app which initially creates static config files (once) and after files were written I need to reinitialize/restart the application. Is there something to restart a node.js app from itself? This is required cause I've an application running in two runlevels in node.js. The initial one sta...

 
3:03 AM
0
Q: Minify server-side JavaScript (Node.js)?

tejas-manoharWhen I'm writing a web application, I know that it's good practice to minify JavaScript that is on the client-side (often through solutions like uglify). Are we supposed to do the same with JavaScript/Node.js that runs on the server-side? My assumption is no since the client's browser doesn't rea...

 
3:18 AM
0
Q: Mongoose - .populate issue when populating array type nested object

sabariI am trying to populate a object myObj. After saving values to 'a' object, I am able to see the data for 'myObj' in the db. But when I query for the obj 'a', its not pulling the 'myObj' data. My Schema is as below. var a= new Schema({ b: 'Date', c: { d: { type: Schema...

 
3:46 AM
0
Q: http.request timeout callback in Node.js

BossaGroovecurrently I used the following code to handle the timeout: var request = http.request(options); request.setTimeout(30000, function(){ //when timeout, this callback will be called }); request.on('error', function(e){ //on error when request, this callback will be called }); The prob...

 
4:10 AM
0
Q: ER_TRUNCATED_WRONG_VALUE_FOR_FIELD: incorrect integer value when using mySQL

user3823823I keep getting this error message ER_TRUNCATED_WRONG_VALUE_FOR_FIELD: Incorrect integer value: 'id' for column 'ID' at row 1 And this is my query INSERT INTO practice_schema.third_table (ID, Name, Poster, Actors,Tags) VALUES ('"+keyid+"', '"+drama_name+"', '"+poster+"', '"+actors+"','"+t...

 
4:24 AM
0
Q: Node: name collision on required files

Ervin EThanks for reading!! The question How do I avoid name collision? Is that my problem? Is that the proper term? Details I'm new to node & javascript and writing an app that talks (tcp on 23) to different types of network devices. I decide to create a separate js file per device and I require t...

 
5:01 AM
0
Q: what does var io = require('../..')(server) do?

AaronI've build the project https://github.com/Automattic/socket.io/tree/master/examples/chat locally and it is working great. However, it would be nice to understand a little more about how a socket application works. In the main startup script one of the modules that is pulled in with require is ...

 
5:20 AM
0
Q: MQTT connection Timeout in some client browsers

Balu var myhost="some ip"; var myport="80"; var websocketclient = { 'client': null, 'connect': function () { var host =myhost; var port = myport; clientId = 'clientId-' + randomString(10); var keepAlive = 60; ...

0
Q: Mongoose behavior and schema

MikeNQI am learning nodejs along with mongodb currently, and there are two things that confuse me abit. (1), When a new Schema and model name are used (not in db), the name is changed into its plural form. Example: mongoose.model('person', personSchema); in the database, the table will be called "p...

 
5:40 AM
-2
Q: Gorescript Node.js

FremenHello i am trying to buid my map in gorescript. Here is Github source: https://github.com/timeinvariant/gorescript The tutorial how to run it: https://github.com/timeinvariant/gorescript/wiki but still a i am not able to run it. Can somebody help me? My install path of node.js : c:\Program File...

 
5:52 AM
0
Q: Express.js : Interesting result

MaverickI'm currently learning Express JS from the scratch. My goal is to become proficient with Node and Express. While trying out some examples online, I ran into this interesting scenario. I'm building simple http server. The code is as follows. var express = require("express"); var port = 8080; va...

1
Q: Scope issue calling a callback function inside a loop in node.js

AitorWith the help of glortho in this thread i built this code: for(var i=0;i<datos.length;i++){ bittrex.getticker(datos[i].Currency, function(err, data){ if (err){ console.log('ERROR:', err); return 'ERROR:'+ err; } else { if (data.message!='INV...

 
6:12 AM
0
Q: SELF_SIGNED_CERT_IN_CHAIN error while using npm install

BrijeshWhenever I run npm install , I get an error Error: SELF_SIGNED_CERT_IN_CHAIN. How to resolve this error?

 
6:24 AM
0
Q: MSMQ/JMS with node js configuration

user3818922 Need help on configuring MSMQ/JMS with node js. I have tried to configure serviceBus. But it was throwing the below exception. "Cannot find correct Service Bus settings in configuration o". Anyways I have to configure JMS/MSMQ with node js not ServiceBus. But, I didnt find code...

 
6:49 AM
0
Q: DynamoDb response time

user3760284I am working on dynamodb in node.js using aws-sdk modele. But when I make a request to dynamodb It is taking 400 to 500 milliseconds to get response. I am usinng configuration object as below. { "accessKeyId": "key", "secretAccessKey": "key","region":"us-east-1" } And in app.js var AWS = re...

0
Q: Build a Docker image remotely using Node.js

Golo RodenI want to build a Docker image remotely, by using Node.js. Basically, I've seen that there are projects such as dockerode and docker.io that wrap Docker's remote API, but I'm not sure whether they really are what I am looking for. My basic setup looks like this: I have a ready-made image inside...

0
Q: CLI references wrong npm version

kleinfreundAlthough npm v1.4.20 is installed in C:\Users\Philipp\AppData\Roaming\npm\node_modules, which is also added to the PATH environment variable, the CLI uses npm v1.4.14 installed to C:\Program Files (x86)\nodejs\node_modules. Why? How to resolve this?

 
7:39 AM
0
Q: npm - how to avoid duplicate node module installation for my "sandbox"?

Dmitri ZaitsevI have a "Sandbox" directory to test various node package. Each package comes with its own package.json that requires me to run npm to install its dependencies. That leads to the same dependency modules being installed again and again. Is there a way to avoid this waste? Ideally I would like a...

0
Q: Issue in scrapping with cheerio

BabarI have been trying to scrape 10 websites for a website we are building with links to the original sites, on node.js using cheerio, problem we are getting is that some of the sites have changed which now uses ajax calls to bring their data, my question is how can we get that information, for insta...

0
Q: Node -WebKit apps on Android or ios platform

Dinesh NagarCan i develop apps of android or ios in node-webkit? if no is there any possibility exist in future to develop apps for android or ios platforms using node-webkit? Note: I have googled about this and got to know that we can't develop node-webkit app on android or ios platforms right now. Thanks

 
8:03 AM
0
Q: Are functional Javascript libraries worth the extra overhead?

TYRONEMICHAELI have always been fascinated with functional libraries like Bacon.js and RxJs.js. I recently read the following article on Ramda and it looks very promising. I am interested in this type of coding, but how do I convince my team to adopt it and which one do we choose? Ramda's api makes the most s...

0
Q: How can I run a specify a startup file with an argument using VS2013 node.js tools for Visual Studio?

Samantha JI have a node.js application loaded into VS2013 which has the node.js toolkit installed. I notice when I create a new sample application that it runs the app.js file by default. How can I change this so it runs another file? What I need to do is to have it run this file with the argument that ...

 
8:26 AM
0
Q: Serialize then deserialize mongoose.Model instance

alexandru.topliceanuHere's my problem: I have a system with two hosts: machine M1 and machine M2 each running a node.js process on the same codebase. On M1 I have a mongoose.Model instance (user) which I need to pass (using a REST api call) to M2. I have to have the complete instance of user on M2, ie. all data, v...

0
Q: MongoDB insert with Node.js driver

4m1rI'm trying to find out why my ReST server won't insert more than one document to a collection. The following works fine, but if I try to create a new, slightly different document, nothing happens. Cruds.prototype.save = function(collectionName, obj, callback) { console.log('obj', obj); ...

 
8:44 AM
0
Q: Gulp, livereload, jade

SerheyNeed help. I use gulp-conect and it livereload method. But if I build a few template in time, get a lot of page refresh. Is any solution, I want to build few templates with single page refresh?

0
Q: Node.js / Grunt export log to file

pioSkoIs there any way of exporting the console log of your Grunt build to a *.txt file? I can run grunt in console with the >> thingy to export to file, like so: grunt >> log.txt But it does not log to console, only to file. And I'd like a module/task to do it for me after the build has finished.

 
9:28 AM
0
Q: Node.js windows service , cannot spawn GUI app from service

AlexanderI am running a Node.js application inside a windows service using NSSM , Once a day i check a remote API and spawn an executable file that pops a notification balloon in the system tray . When i run this from a console session this works as expected , but when running from a windows service , i s...

 
9:39 AM
0
Q: EasyRTC General authentication error

Can Şahin BakırI'm trying to do Video Call/Conferance app in NodeJs. When I enter the node page Im getting this error message.

0
Q: node-webkit - AngularJS : Generate PDF and Push to user

BertrandI'm trying to create a PDF and push to user in a standalone node-webkit app. Generating PDF is ok but i'm not able to send it to user. I'have followed indication find here : http://pdfkit.org/demo/browser.html . Here my controller : paiApp.controller('pdfCtrl', function($scope) { var PDFDocu...

0
Q: Node.js POST action keeps reloading the page / can I use ajax?

medziI have this node.js application in where I have a very simple feedback form. So that when the user hits the submit button it fires the POST call to the app.js file and this inserts the feedback into the table in DB. Now, the problem is that when the form is submitted, the page starts reloading f...

0
Q: Combining SailsJS and EmberJS (routing)

SjorsI've been using SailsJS for a while now and find it a perfect REST API solution. I'm currently building an app for both Web & Mobile (native) so I need the REST part of SailsJS. I want to build a frontend for my API right now, and I found EmberJS which looks like a promising framework. I've a que...

0
Q: nodejs and socket.io-redis (socket.io 1.0.6): how to redis subscribe?

asivolellaI just updated socket.io to version 1.0.6 and found out that there is no redis under socket.io/node_modules anymore. So, I npm installed socket.io-redis, as this thread says that it is the correct solution: Migrating socket.io from 0.9.x to 1.x, Problems with configuring RedisStore But, with th...

0
Q: Async and multiple async database calls

GoranI use async lib in my node/mongoose app and got some problems I dont understand. I got this peice of code: var model_1; async.series([ function (callback) { Model1.findOne( {_id: mongoose.Types.ObjectId(model1_id)}, function (err, model1) { if (err) { call...

0
Q: npm traceroute return null value or sometime request hanging

Jaydipsinhi'm using npm traceroute (https://www.npmjs.org/package/traceroute) and i used same script code given as example on above link. test.js: traceroute = require('traceroute'); traceroute.trace('google.com', function (err,hops) { if (!err) console.log(hops); }); node test.js when i invoke abov...

 
10:47 AM
0
Q: How can I install global node modules on openshift?

user3542165I need to install the node.js module sequelize-cli as global to use database migrations on my sequelize ORM schema from the ssh command line. To install the module, can I run an ssh command like: npm install -g sequelize-cli How could it be managed when the application scale?

0
Q: Grunt + Watch + Jasmine works one time, fails the second

Vinz243Here is my Grumodule.exports = function(grunt) { grunt.initConfig({ pkg: grunt.file.readJSON('package.json'), watch: { serve: { files: ['server.js', 'src/**/*.coffee'], tasks: ['coffee', 'develop', 'jasmine'], options: { nospawn: true } ...

 
11:11 AM
0
Q: Trouble with Mongoose and Schema.Types.Mixed

fasmideIm trying to have a completely mixed model but cant really get it to work, here is the complete javascript: var mongoose = require('mongoose'), Schema = mongoose.Schema, async = require('async'); mongoose.connect('mongodb://localhost/whatever'); var SomeDocument = mongoose.model('SomeD...

0
Q: npm install -g phonegap not working

user3782831i am trying to install phonegap in my win8 laptop from terminal. I have no idea can anyone help please? NodeJs version->1.4.14 git version-> 1.9.4.msysgit.0 here is the output. C:\Users\sanjog>npm install -g phonegap C:\Users\sanjog\AppData\Roaming\npm\phonegap -> C:\Use...

0
Q: In node.js mysql query, check if no matching found

user3782480How can I check if no matching found in mysql (node.js)? mysql.query("select * from table1 where name = 'abcd'", function(error, result, field) { if(error) { exist(error); //No error } else if(result) { console.log(result); //displays '[]' exist(null, result); ...

0
Q: In node can we use multiple mysql statements in one connection query?

jpkIn node-socketchat system, i am using mysql module. I wants to take data after checking through 4-5 tables, but cannot make a join statement. suppose i need to take a friends collection and their details. Now i am following below method. var friends = new Array(); var connection = mysql.creat...

 
11:45 AM
0
Q: Q.all doesnt resolve in correct order

GijsI'm having trouble with the execution order of Q's promises in Node.js. The code is supposed to do the following: a) Execute a query and use the resulting lat/lon pairs to b) Calculate shortest paths (using an async function) and c) Return them query() // Runs the query .then(function(...

 
12:01 PM
-1
Q: How to upload csv file in angular js and convert it into json

user3333783I want to upload csv file using input type file in angular js and convert csv data into json data and then send to express

0
Q: How to do inheritance in mongoose (with expressjs)

Maxim GeerinckI am looking on how to use Inheritance techniques with mongoose in expressjs. So far i have come up with this: Base class var mongoose = require('mongoose') , util = require('util') , Schema = mongoose.Schema; function PersonSchema() { Schema.apply(this, arguments); this.add({...

-1
Q: Node.js find related articles

andrepcgI have a MongoDB collection with parsed news from news sites. What is the best and simplest way to find related articles of an article? I'm working with portuguese news so that's a requirement article: { title:, caption:, text:, timestamp:, category:, }

0
Q: No results retrieving document by UUID in MongoDB

user3825282I am trying to retrieve a document from MongoDB. The document has the field "ownerId" that contain a binary UUID. Using the Mongo console if I launch the command db.dataset.find({ownerId: BinData(3,"ZQ6EAOKbQdSnFkRmVUUAAA==")}).pretty() it returns: { "_id" : BinData(3,"VQ6EAOKbQdSnFkRmVUU...

0
Q: Heroku with Django and Node for realtime?

aitchnyuI have seen how a setup of Django, Node with Socket.io and Nginx can be used for realtime. Nginx forwards long-lived comet/web sockets connections to site/socket.io to Node, while it forwards usual short-lived requests to Django's server. What is a similar solution to use with Heroku? I cannot h...

 
12:51 PM
0
Q: File upload/download with NodeJS and cloud service integration

tampetaI am trying to set a web application where many clients can connect through a Node.js http server and then upload/download files that will then be shown in different displays. I am thinking about having those files stored in a free cloud service that can be integrated to my app or if that require...

0
Q: Nodejs Application Webhosting and Domain Server

user3767005i am a new web developer and i devevlop my web in Nodejs using Sailsjs , I've created a website and have also tested it on free server www.heroku.com, now it's time for me to make this website online on my own domain and web hosting. for sake of knowledge i've never made my website live before a...

0
Q: Cache static pages and content nodejs

Hazem HagrassI have a static content to cache using nodejs, as far I know there are two ways: This can be done using nodejs: app.use(express.static(path.join(__dirname, 'public'), { maxAge: oneDay })); Add x.appcahe file with static contents to cache, then add manifest attribute in html tag: <html manifes...

 
1:09 PM
0
Q: Any equivalent of setDeferred() in Node/JS as opposed to setImmediate() and process.nextTick()?

JVerstryThe setImmediate() function allows one to: To schedule the "immediate" execution of callback after I/O events callbacks and before setTimeout and setInterval . The process.nextTick() function says: On the next loop around the event loop call this callback. Is there a way to set a...

0
Q: My API request is slow - where to start investigation on what is causing delays?

user606521I have app hosted on heroku + heroku postgres instance. My REST api fetches some data from DATABASE and returns data back to client. I am using Sequelize.js as ORM and restify.js as server. My API function looks like this: app.get('/test', function(req,res,next){ t1 = new Date() db.getSom...

 
1:32 PM
0
Q: Cloud Code Password Protection Parse.com

James ParkerI have three apps on Parse.com one is my DEV environment, one is my QA environment and one is my live Production environment. Is there anyway to completely block my DEV and QA sites from the outside world? Typically I would do this using .htaccess, but that's obviously not an option. I know that...

0
Q: createBlockBlob and commitBlobBlocks create empty files in BlobStorage

Riccardo CipolleschiI'm developing a web app that can upload large file into the Azure Blob Storage. As a backend, I am using Windows Azure Mobile Services (the web app will generate contents for mobile devices) in nodeJS. My client can successfully send chunks of data to the backend, everything looks fine but, at...

0
Q: Form Data is correct when POSTing in Angular, but req.body is empty in node?

Benjamin LeedsI am trying to do a simple POST call to a RESTful API that I created. I am using Angular for the client-side, nodejs for the server, and mongodb+express+multer for the database. When testing the back-end using POSTman, the objects are created correctly, getting data from the req.body. In my An...

0
Q: Can I run a grunt file from node.js?

MarilouI set up my grunt file like this: module.exports = function (grunt) { // Project configuration. grunt.initConfig({ // Configuration to be run (and then tested). pkg: grunt.file.readJSON('package.json'), protractor: { options: { keepAl...

 
1:59 PM
0
Q: readfile text as dom in node.js

user3163213I am having trouble in reading file with node.js. I have saved an HTML file and at the time of reading it I am using fs.readFile. It is reading file but it renders it at view page as text. I want it to be html DOM element. Reading File- fs.readFile(result.Template, 'utf8', function (err, data...

 
2:19 PM
0
Q: Why this SSH command on Nexpect does not work?

esdrasportilloI am trying to run and get information about docker containers from inside a docker container, to do this I am using Nexpect, but I found a strange error: exports.getIP = function(username, callback){ var nexpect = require('nexpect'); nexpect.spawn("ssh core@172.17.8.101 \"docker inspect -...

0
Q: Expressjs+socket.io+express-session

MenjoyI have this code in my server.js. var app = require('express')(), session = require('express-session'), cookie = require('cookie'), cookieParser = require('cookie-parser'), manager = require('./sockets/manager'); var sessionStore = new session.MemoryStore(); ap...

0
Q: nodejs and angularjs single page application

user1543826I want a nodejs server to host an angular single page application, using angular route module. Does the route need to get the different views from the server every time I navigate to a different view? Is there any way to send a bundle of htmls to the client? Am I missing something really basic?

 
2:52 PM
0
Q: How to find out what is preventing my Node JS application from shutting down naturally?

JVerstryI have developed a node.js application. Yet, at some stage, the application should shutdown naturally. I can see that it reaches the final instruction through a console.log() message. However, Netbeans tells me it is still running. There is something keeping the application alive, although I am ...

0
Q: How to use globally installed Karma plugins

David SchillingI have installed some karma plugins, like: karma-requirejs, karma-jasmine... globally using npm install -g Now i want to use them in a karma test execution. The only way i found to use them ist to use the require function in the plugins section of the karma config: plugins: [ require('/u...

0
Q: Node.js windows autentication cert untrusted

J33nnI'm trying to create windows authorization for part of my app (written in node.js). Unfortunately LDAP server I'm working on has badly signed certificate which prevents lib I use passport-windowsauth from working properly which ends with sad message: Error binding to LDAP dn: undefined code: und...

0
Q: Crashing on push to Heroku with Node.js Express Server with Sockets.io

Jack WildI'm having trouble deploying to Heroku. I have succeeded in doing this in the past and the basic setup and servers of both Apps are the same. However one fails and one works. A lot of the related StackOverflow posts seem to talk about the server port assigned by Heroku, but I have implemented th...

0
Q: Server API and pages in same Express app?

Fez VrastaI need to provide a set of API and some rendered page using Express. Should I put API and pages in the same ExpressJS API? This is my API example: app.post("/pdf/create", function (req, res) { printPdf(req.template, req.data, “pdf-data/”, callback); }); And this is the pag I need to prov...

0
Q: Socket.io Push-Notification

MonkeyBizzIs there possible to build your own node.js + socket.io server for use as a push-notification-service to my phonegap/cordova project? Is there any good example/tutorial how to use socket.io to push message from one user-device to another user-device? thanks!

0
Q: Save a HTTP GET request that contains Hebrew text in Node.js

RonI have a dynamic JSON file hosted on a remote server (acting as some kind of an API), and it also contains some Hebrew text in its values. How can I save the response and parse it a a JSON object? That's what I've got so far using Request (https://www.npmjs.org/package/request): var options = ...

0
Q: How to update an object (associative array) in mongodb

Chris WilsonI have a corpus of text spread over 180,000 text files, and I want to build a simple index of the words in Mongo. Each article has a uniqueID and is already tokenized. Ideally, each entry in my index would like like this: { _id: "shuttle", instances: { article_1: 5, article_890: 1, ...

 
3:33 PM
0
Q: Is there any way to link c++ libraries to node.js using make not .gyp?

IZeekeI have c++ libraries that I would like to use with node.js, but I do not want to create a completely new make system using .gyp if my existing make system will work. (I am using 'make; in conjunction with gcc.) Is there anyway to retrofit my make system to produce node.js compatible binaries?

-1
Q: Mean stack explanation connection

byrdrI've created an app with Express and Node and am now trying to incorporate angular into the stack. I have data being rendered to the view from mongo but the connection process is a little unclear to me. How would you best explain the connection logic between angular and express to the mongodb? Wh...

 
3:54 PM
0
Q: jasmine-node is not working on windows

user2465908I am running jasmine-node test on windows. I have following command in my package.json. "scripts": { "test": "./node_modules/.bin/jasmine-node --coffee sample_spec.coffee", } when I run npm test, I am getting following error: TypeError: Cannot read property '1' of null at ...

 
4:18 PM
0
Q: Chunked encoding not working

Lucas TanI have a problem with chunked encoding. Here's a sample code: opts={ hostname: "httpbin.org", path: '/post', method: "POST", headers: { "Content-Type": "text/plain", // should default to chunked 'Connection': 'keep-alive', }, }; var req = http.request(opts, ...

-1
Q: Converting a pdf into an excel file

user3826281Does anyone know if there is a way to convert a pdf into an excel sheet in javascript? I've been trying to do so for hours in node js and so far no luck.

 
4:29 PM
0
Q: throw er; // Unhandled 'error' event Error: listen EADDRNOTAVAIL

StellaMirandaI'm trying to run a node.js app locally, I installed all the dependencies by npm install I have mongodb running in a separate console tab, showing something like [~/apps/Mi aguila]$ sudo mongod ...

 
4:40 PM
0
Q: How to get date field in timestamp format from oracle?

BdfyHow to get date in timestamp format from oracle, using node-oracle ?. to_timestamp in sql don't work.

0
Q: Express validator - how to allow optional fields

YashuaI am using express-validator version 2.3.0. It appears that fields are always required req.check('notexist', 'This failed').isInt(); Will always fail - broken or am I missing something? There is a notEmpty method for required fields which seems to indicate the default is optional but I am not ...

 
4:56 PM
0
Q: Node Non-Blocking Data Processing

Dylan KirkbyI have a Node process that handles both incoming data packets (once per second) from a microcontroller using node-serialport and incoming http requests from a browser using Express. The data is stored and accessed from a Mongo database. This is the code that handles the data from the serial por...

-2
Q: Will this work? Node.js (dynamic http or https request) ----> Newbie

user2685083Some one share me will this work. After i tried this that console.log didn't print anything? var http = require('http'); var https = require('https'); var requested = process.argv[2]; var requests = (requested === "https" ? https : http); var req = requests.request('http://www.google.com/index....

 
5:08 PM
0
Q: Add views, controllers and models without restarting Sails

KarnithFor starters, let me say I really like Sails framework with it's blueprint routes and restful api. So, this is my question and scenario to get a better understanding of where the limits of Sails and NodeJS are. Scenario: I would like to build an app that is modular in design. The core app will ...

 
5:26 PM
0
Q: hapi.js best way to handle errors

CatfishI'm creating my first node.js REST web service using hapi.js. I'm curious as to the best way to handle errors let's say from my dao layer. Do i throw them in my dao layer and then just try/catch blocks to handle them and send back errors in my controller, or is there a better construct for this? ...

0
Q: Password protect AWS Node EB application

Thomas McCabeI've got a Node Elastic Beanstalk app up and running (though ELB). Right now it is just the AWS sample Node application on the server. Since this is a development server, before I can push my actual code up to the server I need to password protect the entire thing (this is to be used for client r...

0
Q: Nested while loop for promise

user2127480I have followed the post Correct way to write loops for promise. to create loops for promise successfully. However, it seems that this method doesn't work with nested loop The loop I want to simulate: var c = 0; while(c < 6) { console.log(c); var d = 100; while(d > 95) { co...

0
Q: Node.js with Google Cloud, (and Ooyala if possible)

user3826544I want to make a simple webpage, that has a form where users can upload media files. Non-videos (i.e. images, pdfs) will be stored on Google Cloud. Videos will be stored on Ooyala. when a user goes to his/her profile page, the files that they uploaded will be displayed. So I need to get, store,...

 
5:57 PM
0
Q: Can I run multiple instances of a Socket.IO node app on the same machine without changing the socket.IO port for each instance?

jt0ddLets say I build a node app called Program_v0.0.1 running Socket.io on port 4545. var socket = require('socket.io')(4545); With PM2 (It allows one to run multiple instances, keeps them running, etc), I run Program_v0.0.1 I want to also run an instance of Program_v0.0.2. Do I need to change th...

0
Q: xdg-open : no method available even after installing xdg-utils

neolivz4everI am using generator-angular-fullstack. On my local machine its working fine, I run grunt serve it starts server but in VPS it's failing Warning: Command failed: xdg-open: no method available for opening 'http://localhost:9000' and I have already installed xdg-utils $ sudo apt-get inst...

0
Q: Javascript: regex escaped space

Vinit SachetiI have a directory with space on unix, so the space is backslashed. And I need to replace the backslashed space with semicolon. Tried multiple regex'es but not able to find the answer var str = '/test\ space/a.sh -pqr'; console.log("replace: ", str.replace(/\\\s+/g, ";")); //This one doesn't wo...

0
Q: How to catch ERR_CONNECTION_REFUSED thrown by browser if server goes down?

BigMarioI think this question is pretty straightforward, but I haven't found an answer yet in the official Socket.io docs. I have my Socket.io server and client communicating successfully, and when I shut down the server, the client will attempt to reconnect with the server unsuccessfully. This is shown...

0
Q: Draw arrow between tree nodes

user3600270I'm trying drawing lines with arrows between nodes in a tree. Nodes and lines paint as I want.My problem is with drawArrow method() it doesn't draw anything. However, I could draw arrows by drawing three lines, but I have to use "fillPolygon" to draw the arrows. Can someone see this method and ...

0
Q: TypeError: Object #<Promise> has no method 'forEach' mongodb

user3487077I am trying to copy a document from one collection to another using MongoDB and nodejs in visual studio. Here's what I am trying to do: var newcollection = db.get('mynewdata'); var oldcollection = db.get('myusercollection'); var userName = req.body.username; oldcollection.find({ "username" : us...

0
Q: Node.js Bluebird Promise complains of "Converting circular structure to JSON"

dmanFor making a outgoing api call, I am using restler wrapped in a bluebird promise object. However, I am getting a Possibly unhandled TypeError: Converting circular structure to JSON at node_modules/bluebird/js/main/promise.js. What can I do about this? rest.postJson(uri, body).t...

 
6:44 PM
0
Q: Does setting Access-Control-Allow-Headers remove cookies

apparatixI'm running an Ajax request to a remote Node.js server, and I set this header on the server: 'Access-Control-Allow-Headers': 'Origin, X-Requested-With, Content-Type, Accept' On the server, I'm trying to access some information about the user's cookies, which usually can be accessed by the foll...

 
7:08 PM
0
Q: nginx node express 502

Peter Van de PutOn an AWs instance installed and configured NGINX without and working. Configuration is simple /etc/nginx/conf.d/virtual.conf server { listen 80; listen somename:8080; server_name demo.mydomain.com; location / { root /home/ec2-user/site/demo.mydomain.com/; ...

 
7:18 PM
0
Q: returning function calling another returning function

JAT2007Im trying to call a returning function inside another returning function but I'm getting myfunctionName is undefined.. here is the code function(){ ... .... return{ myfunction1: function(param1,param2){ var doSomethingHere; }, myfunction2: function(){ .... ...

0
Q: Plotting Statistical Plots like Volcano in JavaScript

SinnerShankyI want to plot graphs like Volcano Plot, MA Plot and BCV Plot for datasets using JavaScript and/or Node.js Is there anything available that I can use to be able to plot it? PS: I used d3 but its too cumbersome when it comes to these Plots.

0
Q: how to add a session_id in request header using node.js request module?

user3821715i am trying to scrap a site using nodejs, and request module. it required a log in the user is authenticated and also getting the ASP.NET_SessionId but its is not scraping the required page. i am trying this code. var request=require('request') url= "www.mysite.com/myinfo.aspx"; request( { meth...

0
Q: Can you use module.exports with a class instantiation with new?

owensmartinI'm using the following pattern to build my express app. When I match a route, I like to delegate to an object that is an instance of a particular class, designed to handle that kind of request. It looks like this server.js: app.get('/myroute', require('myRoute')); myRoute.coffee: iMyRouteHa...

 
7:41 PM
0
Q: mongoose plugin late load

lgabriellpCan I load plugins on already defined mongoose models? Supose a plugin loading below: var Foo = mongoose.model("Foo"); Foo.schema.plugin(function(schema, options) { schema.statics.bar = function() { /* some code here*/ }; }); Is there any way to call new defined bar method from Foo? Foo....

0
Q: Pre-Signed S3 URL Signature Does Not Match

Onur ÖzkanTitle says everything. Here is my code; I'm using node-formidable for files. form.on("end",function(field, file){ params.Body = fs.createReadStream(params.filePath) delete params.filePath; S3.getSignedUrl('putObject',params, function(err, url) { if(err){conso...

0
Q: nodejs socket hang up when sending request

BloodcountI am trying to do the following: Send a request. The server should print the request body and then send a small response. The request's callback should print the response from the server. Somewhere along the line I have done something wrong. I can't figure out what it is. Server: var http = r...

 
7:59 PM
0
Q: Write javascript code that works with client side javascript and server side NodeJs modules

sensorarioWell, ... I can write some javascript code. Also, I can write NodeJs code. Ok: I can write a module for NodeJs, for server-side code but at some point I need to write a NodeJs code to export, for example, a module. var MyModule = function () { this.attribute = 666 } module.exports = MyModule...

0
Q: Configure TimeOut and Transports in Socket.IO 1.0

TomazioIn old versions of Socket.IO (< 0.9), i configured the Close TimeOut and Transports of this way: io.set("transports", ["xhr-polling"]); io.set("close timeout", 3); But now, the command io.set has been deprecated, how i define in the close timeout and transports? When i use the old version thi...

 
8:11 PM
0
Q: xmlReader Failed with: TypeError: Cannot call method 'text' of undefined

Steven BurnettI am using the npm xmlreader to parse my xml I am receiving from yahoo weather on parse's cloud. I have been using the examples from the git repository and the example here: https://www.npmjs.org/package/xmlreader to try to see if I can get the contents of any node at this point and I am having n...

0
Q: I cant connect to my Amazon ec2 running nodejs using tcp

user2765977Hi all I have created an Ubuntu EC2 instance and have installed nodejs on it. Am running a simple node js script (which IS running and not throwing any errors: var net = require('net'); var server = net.createServer(function (socket) { socket.write("from server\r\n"); socket.pipe(socke...

0
Q: Unable to get Jasmine working with basic library

xam developerI'm new to using Jasmine and Grunt (and StackOverflow). I'm trying to setup the most basic of projects. However, when I run my grunt task, I get an error that says: Running "jasmine:testShared" (jasmine) task Testing jasmine specs via PhantomJS >> Error: notloaded: Module name "../" has not bee...

 
8:31 PM
0
Q: How to properly get response from node server

Chauncey PhilpotI have a service with service.factory('EventService', function($resource){ return $resource('/viewEvent/:eventID', {eventID:"@eventID"} ); }); and I have in the server.js file app.get('/', routes.index); app.get('/viewEvent/:eventID', function(req, res){ console.log(req.p...

 
9:03 PM
0
Q: RESTful CRUD for Angular and Express $resource

byrdrI have my JSON querying and creating correctly. I'm a bit stuck on how to remove items from the server. They are being removed in angular but I can't seem to get the connection right for removing them on the server. My server.js: var hcController = require('./server/controllers/services-cont...

 
9:16 PM
0
Q: Unit testing output, depending on Math.random()

BrendonI have some functions in a Node.js application whose output depends on Math.random(). Is it possible to unit test these functions? If so, what is the best strategy?

 
9:34 PM
0
Q: Accent or Pronounciation Comparision for Andriod App

user3430106I am very new to speech related technologies and have no clue on what to look for. If someone with experience could point or guide me in right direction, it would be great help. I am working on Android App that is for Accent reduction training. It will have prerecorded sentences by professionals...

0
Q: Express.io session sharing not work

user3827134I am a very, very new in node.js and I have a small problem: I find express.io module but it not sharing sessions between web requests and io requests. My code : app.js express = require('express.io') app = express().http().io() app.use(express.cookieParser()) app.use(express.session({secret: ...

 
9:45 PM
0
Q: How can I access app.locals within User model file?

AnthonyI've created a file to hold some application wide configuration using app.locals. That config file looks like this: config/vars.js // App wide variables module.exports = function (app) { app.locals.accessLevels = [ { "levelName" : "Basic", "scrapes" : 3 ...

0
Q: grunt task error while building node webkit example for windows

NathanI'm following along with tutorial to build a node-webkit project. Everything worked fine up untill i ran grunt dist-win then i get the following. H:\nweb-sample>grunt dist-win Running "jshint:files" (jshint) task 1 file lint free. Running "clean:dist" (clean) t...

 
9:57 PM
1
Q: Node process exits without error

jbhelfrichSo we're about to move a large amount of content from one site to another site, and all the content will have different paths. The webserver will be using 301 redirects to make sure that people with existing bookmarks get to the new resource. I've been asked to write a script that will test tha...

0
Q: Node.js emit to a specific listener

SantosIt's possible emit to a specific listener in node.js? A example: emitter.js var EventEmitter = require('events').EventEmitter; module.exports = function() { var controller = new EventEmitter(); return { set: function(opts) { setTimeout(function() { ...

 
10:10 PM
0
Q: How can I deploy this application(https://github.com/HenrikJoreteg/SimpleWebRTC) on nodejitsu?

noleI was trying to deploy this demo application(https://github.com/HenrikJoreteg/SimpleWebRTC) from SimpleWebRTC on nodejitsu. But I got the following error. On jitsu start I am getting this error: info: Welcome to Nodejitsu nole info: jitsu v0.13.18, node v0.10.13 info: It worked if it...

0
Q: Complex addition to subdocument array with mongoose

Lambda DuskMy data model has Accounts, and an accounts has some credit transactions for it. I have designed these transactions as subdocuments: var TransactionSchema = new Schema({ amount: Number, added: Date }), AccountSchema = new Schema({ owner: ObjectId, balance:...

0
Q: node-http-proxy not passing post data

deadServer listening on localhost:8080 PhantomJS listening on localhost:8081 Proxy setup to send request to PhantomJS from Server var proxy = httpProxy.createProxyServer({ target: 'http://localhost:8081'}); var server = http.createServer(function(req, res) { if (req.url === '/phantom') proxy...

0
Q: Cannot get CORS and withCredentials to work nodejs

CorheroRelevant server side code (routes.js served up on http://dev.maindomain.com): var cors = require('cors'); ... main.get('/some-view', getWhitelistedDomains, cors(cors.corsOptions), function(req, res) { res.render('some-markup', { layout: false, loginStatus: req.loginStatus ...

 
11:02 PM
0
Q: How do I parse my JSON with external middleware now that Express doesn't carry a body parser?

jt0ddHow do I parse my JSON with external middleware now that Express doesn't carry a body parser? For a while, I was using Express bodyParser to receive and respond to JSON posts to the server. Each time I started up the server, express said something about bodyParser being removed soon, and sure en...

0
Q: Jasmine toMatch method not working

user3754111Trying to test time format. utilities js file: exports.getCurrentTime = function(s) { var now = new Date(); var mins = lzero(now.getMinutes(), 2); var dateTime = ' ' + now.getHours() + ':' + mins; return dateTime; }; Specs class: utilities_spec.js require("/tijasmine/tijas...

 
11:15 PM
0
Q: mongoose /node how to handle exception

cooolI have an validation during save of a model. the validation is going against the empty value and trying to split it and it errors out..it thrown out the node itself. I am passing a call back to save it not being called...but if there i a proper error(when I trim and do the check and send false it...

 
11:33 PM
0
Q: Error turning Amazon S3 function into promises using when/node

CodyI'm trying to lift an AWS S3 async function, and running into a weird error. Given the following code, var s3 = new AWS.S3(); var when = require('when'); var nodefn = require('when/node'); var getObjectP = nodefn.lift(s3.getObject); getObjectP({ Bucket: 'bucket_name', Key: 'key_name' }...

0
Q: Node.js connecting through ssh

user3251849I have a node.js server that works but needs to be set up for ssh connections: var mysql = require('mysql') var io = require('socket.io').listen(3000) var db = mysql.createConnection({ host: 'hostname', user: 'username', password: '12345', database: '12345', port: 3306, ...

0
Q: external css files break jade view

user3462064Am new to node.js and am sorry if the answer to this question is too obvious i build my app logic with all the routes and views and it work all fine , till i wanted to extend more styles to my views which i used Jade to build them as am using Express, the only change i did is i included bootstr...

0
Q: RESTful web service url html vs json

user2744437To generate urls for accessing data for customers, I follow the specification: Deliver all JSON data pertaining to customers at the URL: wwww.somesite.com/customers To create, update or delete, use the www.somesite.com/customers/ url with the appropriate verbs i.e. POST, PUT and DEL respectivel...

0
Q: Node.js Forever is not creating Log files

Nyxynyx2 nodejs scripts are being handled by forever. The system is using forever v0.11.1 and node v0.10.29 # forever list info: Forever processes running data: uid command script forever pid logfile uptime data: [0] D34J userdown app/main.js 7441 10950 ...

 

« first day (54 days earlier)      last day (23 days later) »