« first day (10 days earlier)      last day (67 days later) » 

00:03
0
Q: Twitter API request is successful with REST client, but request from Node server returns 400

user3183170I'm able to successfully make a request to the Twitter API using a REST client with the following options: https://api.twitter.com/1.1/users/show.json?screen_name=chrisryanphd Host: api.twitter.com User-Agent: myApp Authorization: Bearer ******** Accept-Encoding: gzip However, when I try to d...

00:33
0
Q: Saving the user session with a single page app using CORS?

Michael Joseph AubryI have read a few articles around the web and even implemented a few, but for the most part following along is quite tedious and gets a bit off track from my base code causing confusion and wasted time. That said I know I am close with how I have things implemented, I just need access to the re...

00:45
0
Q: 404 error jquery post ajax request to node.js

PhilibobbyI am currently working on a ajax request that uses jquery and that communicates with a node.js server. The problem is that the ajax request works with the get method but not with the post method. The working get request will retrieve the right data and they will be processed with no problem: $....

01:14
0
Q: Naming convention suggestion for 'global' variables in your node component

MattijsI am building a REST api using Restify in Node.js and I was running in a trivial issue that I have defined a couple of global variables within the Node module (which are not global but confined to the modules scope if I am not mistaken). However, in some of the REST Endpoint handlers I populate ...

01:51
0
Q: Make a blocking call to a function in Node.js required in this case?

Nemil A TimbadiaI am starting to learn node.js. I am stuck with a problem here. I am calling a weather service which returns a JSON(url below). http://api.wunderground.com/api/Your_key/conditions/q/CA/San_Francisco.json I want to display the results from the api on an HTML page. I have written the following...

02:03
0
Q: fieldname "type" in my schema

japrescottI have a really strange situtation; my schema has a fieldname which is called "type" type: { type: String, default:"cow" } the schema is extended by subclasses which override the type field name to change the default value when I create the document and directly after the cb fires, find it an...

0
Q: how to alert, if there are more than 50 requests in 10 seconds from the same IP Address

user3422130I got IP address of client with this function: function getClientIp(req) { var ipAddress; // The request may be forwarded from local web server. var forwardedIpsStr = req.header('x-forwarded-for'); if (forwardedIpsStr) { // 'x-forwarded-for' header may return multiple IP...

0
Q: Node Js performance optimization involving http calls

user3385957I have a node js application which opens a file, scans each line and makes a REST call that involves couchbase for each line. The average number of lines in a file is about 12 to 13 Millions. Currently without any special settings my app can completely process ~1 Million records in ~24 minutes...

02:38
0
Q: Mocha, Express test error - "after all" hook error - Object function has no method 'close'

BenIm just getting started with Mocha, testing against a very basic Express 4.0 rest API. describe('API CALL UNIT TESTING', function(){ var app = require('../../app'); before(function(){ app.listen(3000); }); describe('GET', function(){ it('respond with json', func...

0
Q: Yeoman generator-angular-fullstack enabling ssl

user1200387Trying to be able to run a SSL server using the generator-angular-fullstack https://github.com/DaftMonk/generator-angular-fullstack. However when I look at all the examples for enabling SSL, when I comb through the code it doesn't seem to initialize the server the same way as the NodeJS document...

03:19
0
Q: Mongoose - finding a subdocument within an array, and returning that sub document

Dominic Bou-SamraI have a schema like so: var personSchema = mongoose.Schema({ minders: { type: [minderSchema], required: false } } var minderSchema = mongoose.Schema({ display_name: { type: String, required: true }, minder: { type: mongoose.Schema.Types.ObjectId, ref: 'Person', required: true } }) I wo...

0
Q: Mongoose inserting \u0000

user3678146I'm having trouble inserting text in mongoDb from an html input. I have this html bad boy here : <input id="cats" type="text" class="form-control" /> I am using mongoose to save this : function saveACat(){ var fluffy = new Kitten({ name: $("#cats").val() }); fluffy.save(function(err,fl...

03:37
0
Q: Node.js net data's toArrayBuffer isn't a real ArrayBuffer?

ZECTBynmoI'm setting up a server that communicates with raw TCP using the 'net' module. I noticed something very strange: the data has a toArrayBuffer method, but it returns something that isn't an ArrayBuffer net.createServer( function(socket) { socket.on('data', function(data) { var ab = da...

0
Q: Unset Environment Variable in grunt-env

trysisIs there a way to unset environment variables with grunt-env? I know I can set them from the module, and there is even a way to set them to a value only if it doesn't exist. However, the project's GitHub page does not seem to show how to unset them. Any solution would be better if it also include...

04:07
1
Q: node.js, cluster mode, log aggregation and logrotate

Nitzan ShakedNode has a "cluster" module, using which one can create a parent process that forks worker children. The worker children all listen on the same socket, thus load balancing between them (and thus between CPU's) happens at the kernel. Such a process would also have to monitor for children dying an...

04:19
0
Q: MongoJS Node.js modules:"db is not undefined"

JazzaI'm new to Node.js, MongoDB and MongoJS. I have app.js which is which is the server I run from my command line with node app.js. On a local machine with OS X 10.9.1 with Node.js v0.10.28. In app.js I have (as snippets) var db = require('./database'); var blog = require('./classes/blog'); an...

04:33
0
Q: Manually promisifying pg.connect with Bluebird

luisfarzatiI want to promisify node-postgres' pg.connect method along with the inner connection.query method provided in the callback. I can .promisify the latter, but I need to implement the first one manually (if I'm missing something here, please explain). The thing is, I'm not sure when to use .defer ...

0
Q: mongodb replica set config version error

ededI have three machine running on amazon cloud. I set the first primary set as follows { "_id" : "rs0", "version" : 270805, "members" : [ { "_id" : 0, "host" : "xxx.xxx.xxx.xxx:27017", "priority" : 2 }, { "_id" : 1, "host" : "xxx.xxx.xxx.xxx:2701...

05:20
0
Q: Node.js nested callbacks

user1907849I have a very basic question in node.js programming . I am finding it interesting as I have started understanding it deeper. I came across the following code : Abc.do1(‘operation’,2, function(err,res1) { If(err) { Callback(err); } def.do2(‘operation2’,function(l) { } ...

05:50
-1
Q: What is batter GO or Node.js?

user3678439Well , I want to create highly scalable web server , having millions of concurrent connections , I know node and go both have capabilities , but which is batter doing at low resources ? I have tried with node , but I am curious about go lang as its Google product. so please let me know why should...

06:01
0
Q: socket.io and node.js gives error on localhost

Muhammet ArslanI have a development server working on 192.168.1.22 and i want to run node.js on it but it gives some error. I want to only test some cases but even can't run it. After i run it i will fetch my onclick button and from node.js sent that post to my php file. and return data from php to node.js and ...

06:20
0
Q: Node.js or Apache/PHP for a web based application for email marketing

user2078768I'm going to create an application for email marketing for a client. I have good experience in PHP but I'm curious about node.js if it can work better than PHP + APACHE with the following features : Min 100,000 receiver at once Ease of use Very high sending capacity per hour Reports like view r...

06:39
0
Q: Meteor get autovalue _id inside collection

user1381537I have this field which is working as I want tagSlug: { type: String, label: "slug", optional:true, autoValue: function() { if (this.siblingField('tag').isSet) { return URLify2(this.siblingField('tag').value); } } } But I also want to make another fiel...

0
Q: Meaning of socket.io listen a express server?

user3160143I am reading socket.io's how to, this follow code I can not understand : Server (app.js) var app = require('express')() , server = require('http').createServer(app) , io = require('socket.io').listen(server); server.listen(80); what is the meaning of io = require('socket.io').listen(serv...

06:56
0
Q: Node, Express, domains, uncaught exceptions - still lost

Ryan WhealeI have been reading for hours on exception handling in Node. I understand the cons of using uncaughtException, I understand that shutting down the process is good for preventing any "unknown state" where "anything can happen". I understand that using domains is the way to go, and I understand h...

07:26
0
Q: Check a string contain particular substring or not

Pawan SinghCheck a string contain particular substring or not. when a user register I want to check entered emailid domain match with my predefined emailid or not(eg @gmail.com ,@outlook.com etc).

07:42
0
Q: socket.io and sails js issue accessing get request query string

mandeep_m91I am sorry if this question has been asked before in the forum but I am not able to find what I am looking for. I am looking to develop a notification mechanism in my sails js app. Taking the analogy of facebook, lets say we have users and pages. Users can follow other users Users can like a ...

0
Q: listen to firefox load event after Node.js spawn call

bksI need to open multiple windows/tabs of firefox using Node. Now, when i use a spawn() call: var spawn = require('child_process').spawn; ff = spawn('firefox', ['www.stackoverflow.com', '-new-tab']); If i use two (or more) calls right after the other, firefox claims there's a page that is not re...

0
Q: How to get the access token for Authorization Code grant type

user3180402I am executing the code in Github for Authorization Code Flow using simple-oauth2 npm. In this code, I can see two flows are there. One to generate the Authorization code and other flow to get the access token. I want to omit the first flow in the mentioned code. I want the code to be something l...

0
Q: Trying to extract a Json string out of javascript in HTML

user3492125I have a complex HTML string. It contains a number of html tags and a few jave script blocks. Each javascript block contains js functions with a few parameters, and each parameter is a Json string. I'm only interested in those Json strings. What's the best way to extract them? Sample code: ...

08:21
0
Q: Double underscore in front of a variable

Anders ÖstmanI have the following code snippet in my node code. var fs = require('fs'); fs.readdir(__dirname, function (err, files) { console.log(files); }); Why does the variable '__dirname' have double underscores? I know that one underscore is a naming convention for a private/protected variable.....

08:39
0
Q: Calling a function from an array

mlesI'm trying to call a function by a number read from the command line. This is my code: saveuser = function(user, callback) { //.. }; removeuser = function() { //.. }; finduser = function() { //.. }; updateuser = function() { //.. } var options = { 1: { op...

0
Q: Detect if have got sudo right info

arachideis it possible to detect if have got root right when run node app.js I hope when run command sudo node app.js it will tell the app.js that node is running with sudo right.

08:54
0
Q: S3 and cochebase - How get a file from Amazon and store it?

Or SmithI'm trying to get a file from S3, and store it in NOSQL couchbase. I'm trying to store the outputStream, with the following code: var outputStream1 = fs.createWriteStream("./tmp/" + url); // if statusCode == 200, then we have the file, lets save it in out cache and then send it ...

0
Q: zip directory nodejs with archiver

steoI'm using the archiver module ( https://github.com/ctalkington/node-archiver ) to create an archive from a directory but I've got a problem; It doesn't store images despite, I guess, I'm targeting the whole directory. The function relative to this step is: var output = fs.createWriteStream(file...

0
Q: nodejs: Check if variable is readable stream

user3351722How i can check if a var is a readable stream in Nodejs? Example: function foo(streamobj){ if(streamobj != readablestream){ // Error: no writable stream }else{ // So something with streamobj } } I tried if (!(streamobj instanceof stream.Readable)){ But than i get a...

09:30
0
Q: After password reset remove all session cookies for that user

StelioI'm using https://github.com/panique/php-login-advanced login script, also there is a NodeJS server which authenticates users by their session cookies. The problem is when the user resets his password, he's still able to authenticate with his old session cookie. My goal is to remove all cookies f...

0
Q: Node_modules path corrupt, impossible to commit on GIT

DimitriI am trying to keep a version of git of all the components inside node_modules. I just removed from .gitignore the node_modules folder, I was expecting to sync without any trouble until I get that : The file will have its original line endings in your working directory. warning: LF will be repla...

0
Q: Socket.io, cluster, express and sync events

throrin19I have a big problem sice 1 week. I try to convert my node.JS project actually run on single core to multi core with cluster. With websockets, at this moment, i have no problems for events but, for xhr-polling or jsonp-polling, i have big problems with socket.io on cluster mode. this is my serv...

10:05
0
Q: HAProxy Sticky Sessions Node.js iOS Socket.io

Lewis BarberI am trying to implement sticky sessions with HAProxy. I have a HAProxy instance that routes to two different Node.js servers, each running socket.io. I am connecting to these socket servers (via the HAProxy server) using an iOS app (https://github.com/pkyeck/socket.IO-objc). Unlike when using ...

0
Q: update multiple documents in single mongoose command with a variable

KokaI have the following collection [ { a : 'One', b : 'Two' }, { a : 'Three', b : 'Four' } ] I want to update the collection in single query such that i will append substring 'numbered' to each of the 'a' property of each document in collection. resultant collection should be : [ { a : 'Onenumb...

10:23
0
Q: Not able to access nodejs application running in Azure VM

TheVillageIdiotI have created a linux virtual machine (from bitnami MEAN 2.6 image) in Azure. I have added following as an end-point: Name Protocol Public Port node TCP 3000 But when I run sample node application (on port 3000), I am not able to access http://mydomain.cloudapp.net from ou...

-2
Q: Socket io is not working in android 4.4 version on real device

user3445564My Current setup. minSdkVersion ="8" socket.io libs="https://github.com/Gottox/socket.io-java-client" permission in AndroidManifest.xml <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> currently i am w...

10:56
0
Q: npm test fails for custom yeoman generator

Abhishek OzaI have built a custom yeoman generator. You can find the code at https://github.com/abhishekoza/generator-ratchet. When I try "npm test", I get following error 1 passing (454ms) 1 failing 1) ratchet generator creates expected files: Uncaught Error: You don't seem to have a generator ...

0
Q: Output multiple files with GraphicsMagick

leaksterrrI have the following function set up which captures uploaded images, converts them and them writes them to the server. How do I go about renaming the converted file? Currently the function takes the uploaded image and saves out one version of the image. Goals: Save out multiple versions of th...

11:09
0
Q: TypeError: Cannot call method 'get' of undefined

Oleksandr HubachovI try to make a simple CRUD application on node.js using express.js. I try to connect to DB, but I have an error TypeError: Cannot call method 'get' of undefined. Part of my code: app.js var mongo = require('mongodb'); var monk = require('monk'); var db = monk('localhost:27017/notepad'); var a...

11:20
-1
Q: Node.js App | Local Server

TombaIs it possible to build a node.js application, and run/host it on an intern local server of a company (Windows or Linux) ? So just on a normal server where beside of other programs, a lot of data is been saved.

0
Q: github authentication for my meteor application

user1934044Can anyone suggest me the best method of authentication for my application? I'm creting an application where I need the user to login into gmy app using services like fb,google and twitter My application needs github or linkedin data of a user I don't want to merge the login account with thi...

11:43
0
Q: Facebook notifications web sockets vs. pulling?

user3679350I'm a developer at enterprise social network product, and I'm working on a feature that is very similar to Facebook notifications. We want to provide a notifications mechanism for our customers in real time. I'm building a notifications service in node.js that my system can interact with and...

0
Q: how to play sound on raspberry pi - after startup without login

user934801i need to play sound on the raspberry pi with a node.js script. Everything is fine when i'm starting the script from the commandline myself. When i run the same script after startup out of the /etc/rc.local script i see my running process when doing "ps aux" but i cant hear any sound. I also trie...

12:07
0
Q: Running grunt-nodemon and watch concurrently with livereload

nacholibreSo the problem I'm having is with grunt-nodemon and watch runned concurrently, everything works except browser livereload. If I run watch without concurrent, everything works just fine, but then nodewatch doesn't.

12:21
0
Q: node slow and unresponsive with large data file

colsterI've written a simple node program to parse an excel formatted HTML table returned from a corporate ERP, pull out the data, and save it as JSON. This uses FS to open the file and Cheerio to extract the data. The program works fine for small files (<10MB) but takes many minutes for large files (...

0
Q: Significance and Reason for using a callback?

HelloWorldAsync and callbacks are still concepts I struggle with. I have been reading and trying to make sense of code that uses them to gain more familiarity. I don't understand why this snippet of code uses a callback instead of just passing in a value (instead of an anonymous function with the argument ...

12:46
0
Q: Gulp acting differently on remote server

user3679731I run the same gulpfile on local and remote. On local, everything is fine but when on remote, both "vendors" and "assets" tasks are not doing anything and there's no error when I run the gulp. Below is my gulp script - var gulp = require('gulp'), gutil = require('gulp-util'), clean ...

13:10
1
Q: Minify NodeJS project files

Shlomi SassonI'm wonder if minifying my server-side JavaScript files is good for my NodeJS app performance? I'm doing it all the time for the client-side JS + CSS files but i curious if doing it for the files the NodeJS app running is necessary? Thanks.

0
Q: Streams and TCP protocol

Anders ÖstmanI havet this small piece of code. I run it, and then connect with a Telnet client. var net = require('net'); //create server var server = net.createServer(function (conn) { console.log('New connection!') //Message to the one who connects. conn.write ( '\n > Welcome to NOD...

13:30
0
Q: Too many arguments in object containing functions anti-pattern?

Bill JohnstonIn my program, the user supplies an array that defines which functions are run in a loop. I have a bunch of variables which must be passed into each of the functions. The list seems to consistently grow and is becoming difficult to maintain since the argument list appears in many places. Here ...

13:47
-2
Q: is it better to running node.js server in the same main application server or running in other server?

jpkMain application server runs with heavy php application. I wants to know is there any server load will happen because of node server running in main application server or is it better connecting socket to another server which is used for running node ?

0
Q: Npm for "file-system-like" management of private dependencies

phtrivierI'm trying to have this setup : root is a folder corresponding to a git project root/projectA is a node module root/projectB is a node module, that needs to require projectA. Some very important constraints : I don't want to publish any of those node projects to npm I can not have a differ...

0
Q: Smarter way to create JSON response from Mysql

Kioko KiazaI have this code on my Node.js server side: var mysql = require('mysql'); var connection = mysql.createConnection({ host: 'localhost', user: 'SOMEUSER', password: 'SOMEPASSWD', database: 'SOMEDB'}); exports.all = function(req, res){ if (connection) { connection.query('SELECT * F...

14:33
0
Q: App.all doesn't fire on static file access?

foreyezIn my server.js I have: app.all("*", function(req, res, next) { // only gets called when I'm doing a post/get request next(); }); But I'd like to get an event when a static file, such as an html file was accessed on my server?

0
Q: MongoDB and NodeJS get related data from 3 collections

colymorei have a mongoDB query to get data with $group and $count. This data contains the _id from other documents collection. How can i get the other documents by its _id in NodeJS and MongoDB asyncrohnous? db.orders.aggregate([ {$match: { 'works.TechnicianId': {$in:['53465f9d519c9468...

14:55
0
Q: Karma unable to install

Patrick ReckI am trying to install Karma. However, after following the installation instructions I the terminal still says -bash: karma: command not found I attached the terminal in- and outputs below. What am I doing wrong? Patricks-MacBook-Pro:~ patrickreck$ sudo npm install -g karma npm http GET https:...

0
Q: Stuck when running selenium-webserver "[chrome] options can start Chrome with custom args"

materikI'm running selenium with nodejs and javscript but when i try to run my test with the command npm test selenium-webserver it gets stuck after the red line, see image: I have installed chromedriver from http://chromedriver.storage.googleapis.com/index.html so I don't know what to do. Can't fin...

15:12
1
Q: Nodejs High CPU usage

Franz PayerI am trying to determine why my nodejs server has extremely high CPU usage. When running top, I can see that the CPU usage for node can hit up to 60% with a single user. I used node-tick to profile my application, but I cannot seem to understand the results well enough to find the source of the p...

0
Q: Long IDs vs Short IDs

deemeetreeCurrently in my Node.Js app I use node-uuid module for giving unique IDs to my database objects. Using uuid.v1() function from that module I get something like 81a0b3d0-e4d0-11e3-ac56-73f5c88681be Now, my requests are quite long, sometimes hundreds of nodes and edges in one query. So you can...

0
Q: nodejs ENOENT after update

bcamI've updated nodejs from v.0.10.26 to v.0.10.28 and suddently this piece of code: // Start slave process var process = require('child_process'); var ls = process.exec('node slave.js', function (error, stdout, stderr) { if (error) { console.log(error.stack); console.log('Error...

15:49
0
Q: Playing MP3 Chunks using JavaScript

Seif SallamI'm working on a streaming audio server but I'm having trouble playing multiple files after each other (like a playlist). I'm using Binary.js on top of Node.js to stream chunks of mp3 files. Problem is, when trying to play the next file decodeAudioData doesn't work. It stops at the end of the fir...

16:02
0
Q: How to properly remove event listeners in node js eventemitter

coffeedoughnutsI have a set up with a GET and a POST route, the idea being that POSTing to the route triggers an event, and the GET route is a server-sent eventstream which fires each time the POSTed event is triggered... however, i think i've done something wrong as event listeners seem to get added routinely ...

0
Q: Is there any way to supply the allowDiskUse option to an mongoose.js aggregation?

Dan SteeleI'm running an aggregation on a collection of around 300k+ records which requires several unwinds and regroups. I'm hitting the following error; 'exception: Exceeded memory limit for $group, but didn\'t allow external sort. Pass allowDiskUse:true to opt in.' I can't seem to work out how to pas...

0
Q: WebStorm Javascript External Libraries - Node.js

user3680573So I'm using Webstorm to code a Javascript Application for Overwolf. I'm using a Tumblr Wrapper that uses the Node.js library. I set the Node.Js library up in the IDE but I need to add the sources to the project itself. Is there a clean way of doing that from within the IDE?

16:28
0
Q: Socket.io and Passport.js

Nazır DoganI m trying to use Socket.io and Passport.js, I used this https://github.com/jfromaniello/passport.socketio and my code var cookieParser; cookieParser = express.cookieParser('supersecret'); var session = require('express-session') ,RedisStore = require('connect-redis')(session); in ro...

17:03
0
Q: How to compile and install forked omxplayer on Raspberry Pi?

Danny AckermanI'm trying to play a video file in a loop using omxplayer on a Raspberry Pi. I found a module called omxdirector for NodeJS that works really well, but unfortunately, with the native omxplayer, when you play a video in a loop there's a 2 second delay where the user/audience can see the terminal ...

0
Q: Modifying a mongoose query with pre

user602525I would like to be able to modify a find query using pre, I think the best way to ask this question is by example. Suppose I have a query as follows: SomeThing.find({}, 'foo bar baz', function() {}); So I want to find all documents and just return the fields foo, bar, baz. Can I use pre to on...

17:34
0
Q: Mocha: assertions within promise not working

Austin GamezSo, I'm completely new to mocha, and promises and I was asked to write integration tests, which posts form data to a page, gets an authentication key, and then run tests on the key. I'm getting the key back properly, which is confirmed by my log statement, but when I run mocha, my test says 0 pa...

0
Q: A function that has nested callback functions does not return values

deemeetreeI have a function inside of which there is a nested callback function structure. I want that first "mother" function to return a certain value, after it's been calculated in the callback functions sequence. However. it doesn't really work. Here's a simplified version of the code, do you think you...

0
Q: Failed to lookup view "error" in views directory using handlebars

Aoihey guys im new with express and handlebars, i wanted to use handlebars as a template engine on my express.js app but then i keep on receiving this kind of error: which was get generated by this code var express = require('express'); var path = require('path'); var favicon = require('static-fa...

0
Q: Read Gpio with Nodejs

user3093010Its possible read GPIO value then GPIO direction is input. I try use GPIO package, but first value read 0 and next always show that value is 1. I use Raspberry Pi.

17:53
0
Q: Node using http-auth with passport?

user1803975I'm building a node app which uses passport and passport-twitter to allow users to login. Whilst I'm developing the site however I want to password protect the whole thing like using .htpasswd on an Apache server. I've setup http-auth in addition to passport in an attempt to achieve this but it ...

0
Q: expressjs download filename utf-8

Dongju Jungexpress response.download filename is not support utf-8. I wanna download file, file naming utf-8 (not english) I already try Content-Disposition set to header like this... res.set "Content-Disposition", "attachment;filename=테스트 한글.hwp" but not working...

18:18
0
Q: Visual Studio NodeJS Tools - How to Package Project? Create NPM?

MichaelI've got a VS2013 solution with a mix of NodeJS (using TypeScript) and C# class library projects (they're bound together by EdgeJS). Where the NodeJS projects are concerned, one can be considered a library (for a RabbitMQ bus implementation), two are applications which are meant to be hosted as ...

0
Q: How to attach a node.js readable stream to a Sendgrid email?

delwinI'm using PDFKit to generate PDFs. I'm using Nodejitsu for hosting, so I can't save the PDFs to file, but I can save them to a readable stream. I'd like to attach that stream in a Sendgrid email, like so: sendgrid.send({ to: email, files: [{ filename: 'File.pdf', content: /* what to put ...

18:41
0
Q: Make http.request in Node.js work for browser

user850234I want to write a single codebase plugin that works with both Node.js and browser. I am writing the base code in Node.js and then converting it to have support for browser version using the node module browserify. All my GET and POST requests works fine when I execute the code in Node.js. If I wr...

0
Q: Simple script using ajax and node.js, why it don't work?

Mameko MikhailI have html page: <!DOCTYPE html> <html> <head> <title>Test</title> <script type="text/javascript"> function pushMe(elem) { var request = new XMLHttpRequest(); if (!request) alert("Error initializing XMLHttpRequest!"); ...

0
Q: How can I use a node Transform Stream to turn XML into JSON

toddgeistHow do I write a Transform Stream that turns the XML text in a node Req object into JSON so I can pipe it directly to a Node response? I am building a sort of proxy or wrapper around an XML based web service, to turn the XML into a RESTFul JSON api. The idea is this: User makes a request to the...

18:59
0
Q: github api returning nothing

user1934044I'm following arunoda post on npm packages http://meteorhacks.com/complete-npm-integration-for-meteor.html I've tried same like in the post but i'm not getting any result here is the code server var GithubApi = Meteor.require('github'); var github = new GithubApi({ version: "3.0.0" ...

19:11
0
Q: Getting the Spawn EACCES error in ubunt - node environment

monicalGetting the Spawn EACCES error in ubunt - node environment Running "imagemin:dist" (imagemin) task ✔ public/img/github.png (saved 183 B - 2%) ✔ public/img/glyphicons-halflings-white.png (already optimized) ✔ public/img/facebook.png (saved 96 B - 1%) Warning: spawn EACCES Use...

19:26
0
Q: Sails V0.10-rc7 Get a record from the database using REST Blueprints via Socket.IO

FrancoisSails 0.10.0-rc7 Using sails built in blueprints I am attempting to get information from my server using this functionality. (Im looking to user the default behaviour) Client //Client on different server (localhost:8000) //Sails server var socket = io.connect('http://localhost:1337'); socket...

0
Q: Node: import object array from another js file?

user1891836In a file called data.js, I have a big object array: var arr = [ {prop1: value, prop2: value},...] I'd like to use this array into my Node.js app, but code like require('./data.js') doesn't help. I know how to export functions, but I'm lost when it comes to "importing" arrays. How do I add ...

0
Q: sails.js return data from model

user3681108I came from Codeignitor and Laravel background to Nodejs i found that sailsjs is the nearest framework to that logic but the problem i face now is first in controller i call model function [this is fine] then the function return data to the controller [return doesn't return data] and the contro...

19:56
0
Q: Determine request size before processing it

Samuel BolducI need to be able to read the Content-Length header of requests before they are actually processed. My exact problem currently is that I have a mobile application, pushed to many users, who send data every 30 seconds. If the data push didn't work (no internet, for instance) or the server doesn'...

0
Q: Changing a global variable in node.js callback

Gokul N KI am trying to change the value of a variable in the callback function. db.collection("some_collection").find().toArray(function(err, arrayResult){ var myArrayResult = arrayResult; some_asynchronous_call(param1, param2, successCallback, failureCallback); function successCallback() { ...

1
Q: Kill a child nodejs process and delete its directory

ZWand19I am creating an AI competition where competitors can upload their AIs (node servers) to our node server and we take in their code and run it in an automated fashion. On first code upload, I use child_process.spawn() to run node server.js xxx where xxx is their port. I store the spawned child as...

0
Q: Deploying node.js app to Heroku - "No gruntfile found."

ArloWilkinsonI'm trying to deploy a MEAN stack app to Heroku and am running into trouble when it tries to find 'gruntfile.js.' The relevant logs follow: Caching node_modules directory for future builds Cleaning up node-gyp and npm artifacts No Procfile found; Adding npm start to new Procfile Building runtime...

20:28
0
Q: REST endpoints with Sails.js scaffolding

Daniel WhiteI am new to node and new to sails. So this question may be pretty stupid, but I have used the "sails generate prospects" command to generate a REST api. I can access that api by visiting /api/v1/prospects (i set up the prefix). I used chrome's postman extension to POST the following json array t...

20:39
0
Q: TypeError: object is not a function when using csv module

ShorokoI am trying to execute a sample script that reads a CSV file. I copied the sample from this page: http://www.adaltas.com/projects/node-csv/ I get this error: csv() ^ TypeError: object is not a function at Object.<anonymous> (/Users/paulchernoch/Documents/Chris Leung/read-csv-test.js:8:1) ...

21:19
0
Q: How do I get the file id back from gridform?

TonsOfFun111For reference you can check the issue I submitted on GitHub. I am able to stream to MongoDB and the file is persisted and accessible, but the README shows during the parsing you can access the file id. This is required if you want to log or enqueue background jobs for the file. I am unable to log...

0
Q: npm not reading .npmrc file

MaverickI'm trying to install a library from a private repository, and I keep getting an error in trying to use npm. I'm using: OSX Mavericks 10.9.3 Node v0.10.28 npm 1.4.10 (this was installed after trying with 1.4.13 and it still not working) I am running this from my home directory, and the ~/.npmrc...

21:44
0
Q: How to add data do hasAndBelongsToMany in JugglingDB

TalyssonI'm trying to insert data to a hasAndBelongsToMany relationship with JugglingDB, so I'm doing like this: ModelA.hasAndBelongsToMany('ModelB'); ModelB.hasAndBelongsToMany('ModelA'); var modelA = new ModelA({ attr: data }); modelA.save(function(err) { if(!err) { var dataB = { attr: data ...

0
Q: Web Application with Storage using Azure

AndroidDev93I am working on using Azure to maintain a web application that will allow me to store information into a storage system through a web interface. I would then like to query the information from that storage system using a client application. I noticed that there are a variety of technologies that ...

0
Q: What is serving static files?

ZachoozI Googled this and all that came up was how to serve static files. I couldn't find what serving meant or what static files were. Could someone write a detailed explanation of this. I'm a bit new so try not to use very technical terms. I don't really know what to tag this with so feel free t...

0
Q: Moongose auto-increment when document isn't unique

gossetiI’m building a node.js app that fetches geolocated photos from the 500px API based off a location search. The API request requires the page of results you want back. Say for example I search for London for the first time, I’ll request page=1. If I search for it again, I’ll need to search for pag...

0
Q: Global function in app express.js

aurny2420289Trying to use a function in app, that can be called in actions. Put in app.locals doesn't work : app.locals({ "form_tag" : helpers.form_tag, "text_field_tag":helpers.text_field_tag, sendHttpGs: function(req,res) { ...

0
Q: How can I create dynamic links with swig, so I can active / non-active classes on the links?

BucketHow can I create dynamic links with swig templates, so I can active / non-active classes on the links? I want to be able to show which links are active on my template.html page without having to send the request object through to the template everytime

@SomeKittensUx2666 And, what's the reason behind what you say, seriously?
!!mute 3644644 6000
@phenomnomnominal Muted user 3644644 for 6000m
room mode changed to Gallery: anyone may enter, but only approved users can talk
@İnekŞaban seriously, fuck off
0
Q: mongoose for non mongo db database

user2452057Hi I have an expressJS(Client) app which uses another node.js(Server) app as the server. The node.js app exposes URL through which my expressJS app does CRUD operations. It was a design decision to have two different node servers(one for client, one for server). Nodejs(Server) app has mongodb as ...

22:08
0
Q: Unwrap a newly created `ObjectWrap` from `FunctionCallbackInfo`

Gautham BadhrinathanI have an Object that extends node::ObjectWrap as follows: class DNSServiceRefWrap : public node::ObjectWrap { public: DNSServiceRefWrap(); static void New(const v8::FunctionCallbackInfo<v8::Value> &args); private: ~DNSServiceRefWrap(); DNSServiceRef *ref; } In a method that I'...

22:19
0
Q: NodeJS modular approach websocket MVC

user3681507I'm new to NodeJS and I want to implement kind of push notification using web socket. But I want to do it using a modular approach. The system that will detect data change will probably be a database using kind of trigger or it could also be a service pooling the database to detect changes (colum...

22:36
0
Q: Gruntfile.js - Throwing error 'Recursive process.nextTick detected"

Chad MooreI have defined a simple Gruntfile.js per the official instructions and yet I am getting a warning when I run the grunt watch ('$ grunt watch') or grunt default task ('$ grunt '). The error is: (node) warning: Recursive process.nextTick detected. This will break in the next version of nod...

room mode changed to Public: anyone may enter and talk
23:01
0
Q: node's q.fcall returns an empty object

CheruvimIn the node shell I see this: > console.log(JSON.stringify(Q.fcall(function() { return 10 }))); {} undefined HOwever the docs for q here :Q say that it returns a promise, which is an object with an apply() and a then() function. So why is this returning an empty object??

0
Q: npm: How to extract dependencies?

user2820379Using pip one can do: pip freeze > requirements.txt This extracts all dependencies. Is there something similar for npm?

0
Q: Meteor support for data conflict resolution and offline storage

user3681626Does Meteor framework support any conflict resolution? Any techniques or guidelines how to tackle storage of data while Offline in Meteor / Phonegap app? Is it possible with Meteor framework to work offline and then re-sync correctly?

0
Q: Static navbar&footer with nodejs jade and ajax

slepnerpI'm trying to render dynamic content between my static navbar and footer upon clicking the links in my navbar, but every time I click a link it duplicates the content including the navbar and footer. I'm using node with express and the jade template engine. This is my (simplified) top-most jad...

0
Q: Returning a result from callback function that has a database nested function

deemeetreeI have a function inside of which there is a nested callback function structure. I want that first "mother" function to return a certain value, after it's been calculated in the callback functions sequence. However. it doesn't really work. Here's a simplified version of the code, do you think you...

23:32
0
Q: nodejs orm supported custom types and custom query

user2184313Please tell me what are the orm for node js, supporting custom types and custom query. For database postgresql, sqlite? I looked at the Sequelize, node-orm2, camintejs and they are not suitable.

0
Q: Parse large datasets and notify users efficiently

That1guyoverthrI have a huge dataset that increases by hundreds/thousands items for sale every few minutes. I will be parsing this data as it comes in and I'm looking for suggestions on how to efficiently match new incoming items with users who want the item. Examples of how other have done this would mean th...

0
Q: Mongoose find always returning true when it shouldn't

gossetiI’m using Mongoose.js to interface with my Mongo database. This function searches through my Location names and should be logging not found to the console instead of found, as I don't have a Location with the name !@£. Location.find({name: "!@£"}, function(err, obj) { console.log(obj); if (!...

0
Q: node.js url with square bracket

Balu LoganathanIn express.js i am trying to add a router for url /xxx/xxx/items[5] . the url have Square Bracket. Router works fine without Square Bracket, but fails with Square Bracket. Have any one faced this before if so, what is the way to make it work.

0
Q: How to use Angular $cacheFactory in this case?

TyvainI would like to cache resources in my MEAN-stack application. I am trying to use $cacheFactory but it doesnt work. Here is how my app retrive the data: controller <- service <- mongoose So I want the cache to be in the service and to be cached for all users (the app calls the database once, the...

0
Q: Integrating docker logs with nodejs/nginx/passenger app

Abdullah JibalyRunning docker logs doesn't seem to give me any useful log messages. I'd like to be able to see the output of console.log in my nodejs app but that doesn't seem to work out of the box. Any workarounds? Here's my super-basic nginx conf: # /etc/nginx/sites-enabled/webapp.conf: server { listen ...


« first day (10 days earlier)      last day (67 days later) »