« first day (51 days earlier)      last day (26 days later) » 

12:05 AM
0
Q: A stored reference to a socket.io room broadcasts to all users

NathanTo eliminate duplication in an app I'd like to be able to pass a socket by reference to a function like so: var socketRef = io.sockets.in("roomName"); updateStats(socketRef); function updateStats(socket) { socket.emit("something", {data: [1,2,3]}); } However, I've found that this will broad...

 
12:28 AM
0
Q: express - Can't log express-winston log mongoDB using winston-mongoDB

Haseeb JavedI have been trying to set up express-winston using winston-mongoDB but have been unable to do so. The logs are successfully showed on the console but do not apear in my monoDB collection. I have a mongoDB instance running at localhost and it requires no authentication. This is how I have it all s...

 
12:48 AM
0
Q: Why is Node.js not parsing the following page correctly?

HoaIf I access the following page (I know the credentials are invalid): https://apis.live.net/v5.0/me/contacts?access_token=dummy_token In the browser I get nicely formatted JSON: { "error": { "code": "request_token_invalid", "message": "The access token isn't valid." } } How...

 
1:12 AM
0
Q: Denormalizing path separator in Node.js under Windows

AnnieIn Windows, path module of Node.js produces all paths with backslash. It seems like it calls its own normalize() function when other functions (like resolve()) are called. Is there a way to de-normalize the paths (with forward slash), without explicit replacement all over the place? I tried set...

0
Q: Node JS grab the first image in an html string

Usi UsiI'm trying to grab the first image in an html string like this one <table border="0" cellpadding="2" cellspacing="7" style="vertical-align:top;"><tr><td width="80" align="center" valign="top"><font style="font-size:85%;font-family:arial,sans-serif"><a href="http://news.google.com/news/url?sa=t&...

 
1:31 AM
0
Q: Self referencing entity in NoSQL

cvngSince everything starts with a Schema in document objects, how can I provide a self referencing relationship within my collection declaration ? I want to do something like this in MongoDb : taskSchema = { 'description': String, // etc 'workers': [{ 'name': String, '...

0
Q: Assign name via variable for JSON setting Method

user3311351Given a method: account.customData.isJson = "Set" account.customData.save(function(err, customData){//success}); Which returns using: account.getCustomData(function(err, data){console.log(data)}); Printing: {isJson: 'set'} How might I pass variable var title = "isJson" to accoun.customData.**ti...

 
2:05 AM
0
Q: Import hooks in Node.js

modchanI've came across the problem which is just fine solved by import hooks in Python. Is there similar mechanism in Node.js, that allows one to intercept any calls to require() after the hook was installed? I've tried following: originalRequire = global.require; global.require = function(module) {...

0
Q: NodeJS http request fails (response is undefined, Exceeded maxRedirects)

andrepcgWhy does this simple request does not work? Why I'm not able to download that website page? var request = require('request'); request({uri: "http://www.abola.pt/nnh/ver.aspx?id=487828", maxRedirects:1}, function (error, response, body) { console.log(response,error) });

 
2:23 AM
0
Q: Connection attempt from disallowed node 'ejabberdctl@ while connecting xmpp client

BABU KMy ejabberd server hosted in bitnamiapp and my cloud storage is in amazon.I get "Connection attempt from disallowed node 'ejabberdctl@ip-172-xx-xx-xxx'". (where x - means ip address) while I connecting xmpp client from my ubuntu machine.How to overcome this issue?

0
Q: What is javascript or node.js limbo?

Tyler.z.yangRecently, I've been read the TJ's blog article: "Farewell Node.js". I'm not quite understand about the Node fails part. Here it is: Error-handling in Go is superior in my opinion. Node is great in the sense that you have to think about every error, and decide what to do. Node fails however bec...

 
2:52 AM
0
Q: Passport login redirection

Karthic RaoI'm using passport-facebook for logging into the site using facebook(the implementation is complete and working good) .Now , I want to redirect the user to a page containing a form which they are supposed to fill once they login from fb, and without doing it (that is without filling the form and...

 
3:17 AM
0
Q: Node - Scraping Images by Page Index

TheGrayFoxI'm trying to port an image scraper I've written in ruby into node.js. How can I open a url that's needs to be incremented by a page number and iterate over each line in JavaScript? I've provided some psuedo code. downloads = []; page = open('http://'+user+'.tumblr.com/page/'+count.to_s) do |p| ...

 
3:31 AM
2
Q: "npm update" is installing a beta version of the module over the stable version that installed after "npm install"

Alex FordCurrently the npm package mongoose is on version 3.8.12. Running npm install mongoose --save correctly installs version 3.8.12 and saves the dependency to package.json as follows: "dependencies": { "mongoose": "^3.8.12" } If you look in node_modules/mongoose/package.json you can see that the...

 
4:09 AM
0
Q: JSON object gets received as undefined in node.js post?

ConfusedDeerI have a centOS server running a node.js http server (see code below) I'm trying to pass json from the command line: using curl -X POST -H "application/json" -d '{"val1":"hello","val2":"my","val3":"world"}' localhost:3000/app1/webServ1 Here is the code for node.js: var http = require('htt...

 
4:44 AM
0
Q: Pass object as form data to Node/Express -- How to read it with Formidable?

RamselI'm trying to implement user photo upload and it's driving me nuts. I have most of the pieces working except I can't get the cropping coordinates from the passed object. I'm using JCrop of the cropping (FYI) and I capture the crop here in coordInfo: function saveCoords(coords) { coo...

 
4:57 AM
0
Q: Npm package installation fails - how to restore the old working version?

Dmitri ZaitsevIt seems that failed installations attempts with npm delete old versions without installing new ones, which is very frustrating. Can I go back to the old package version that worked? I get this error: gulp -bash: /usr/local/bin/gulp: No such file or directory But I can see I still have old v...

 
5:17 AM
1
Q: sequelize + dataInsert

SubburajIn my node app i am using sequelize as an ORM fro my postgresql database. The following is my model: User: var bcrypt = require('bcrypt'), crypto = require('crypto'); var authTypes = ['github', 'twitter', 'facebook', 'google']; var map_attributes = function() { var obj = new Object(),...

1
Q: Csslint: Background image was used multiple times

TyvainI have this in my css: @media screen and (max-width:1200px) { #cssmenu { background:url(/public/system/assets/img/profile.png) no-repeat , url(/public/system/assets/img/bgprofile.jpg) repeat-x; width: 100%; } } @media screen and (max-width:970px) { #cssmenu { background:url(/public/sy...

0
Q: npm install can't parse json file

taufiqueI am new to both Node.js and Express framework. I tried to create an Express project. After editing the package.json file when I give the command npm install it shows npm ERR! install Couldn't read dependencies npm ERR! Failed to parse json npm ERR! Unexpected string Can someone p...

 
5:45 AM
0
Q: http server and web sockets from separate servers

AleksIt's pretty easy to configure a http server (using express) and a socket server (socket.io) assigned to it: var app = require('express')(); var http = require('http').Server(app); var io = require('socket.io')(http); How can I run http server and socket server in two different node.js instance...

0
Q: Access Socket.IO from Express.js controller?

Corey QuillenI believe I have socket.io setup properly in the main file (server.js) of an Express app. How do I access socket.io from a controller to emit an event as part of a controller action? I tried the following based on a similar post, but I am getting an error saying that socket is not defined. A...

0
Q: How to return query criteria in callback in MongooseJS

user3663009I'm new to the MongooseJS and Node.js and I have the following question. I have some code that processes a number of email addresses. Here is my code: for ( var i = 0, emailsToProcessLength = emailsToProcess.length; i < emailsToProcessLength; i++ ){ Casual.findOne({ email:...

0
Q: Mutex in node.js - Is it essential?

Or SmithI beginner in node.js, and I'm wondering if mutex is essential. I build a server which write, read and delete files. I understand that because node.js is a single thread, there is no reason to use mutex. But on the other hand, what happens if process try to read a files, when the other try to d...

0
Q: NodeJS - sqlite3, data synchronization

user46624I'm trying to write a simple app with nodejs, socket.io and sqlite as a database. This is mostly for training purpose at the moment, to learn how nodejs works and see if it would be suitable for another project. The app is a simple page with a single button. The database is used to store the sta...

 
 
1 hour later…
7:01 AM
0
Q: Static aassets compilation/compression in Parse

GullHow to compress javascript/stylesheets file in Parse ? There is compression module available of expressjs But parse does not allow to use it. Tried following var compression = require('compression') But on parse deploy it says Update failed with Could not load triggers. The error was Err...

 
7:39 AM
1
Q: How to call a function in a function with javascript small explanation

rodolpheI'm a beginner in java script a trying a little program that parse data from a text file. In order to create a filter on a particular date i have made a function to get the date from and to that the user have enter. And the date a have to compare if it is in the range is in the text file, this d...

 
 
1 hour later…
8:45 AM
0
Q: what does it mean to npm install -g

Joe.wangJust a newbie question, I am trying to install the Less from Node.js platform. the command line is npm install -g less. I check the doc from here In global mode (ie, with -g or --global appended to the command), it installs the current package context (ie, the current working directory) a...

 
8:56 AM
0
Q: AngularJS Socket.io: Cannot read property 'emit' of undefined

user3811661currently I am trying to use angularjs with node and socketio. But I am getting the following error. TypeError: Cannot read property 'emit' of undefined at k.$scope.EnteredUsername (http://localhost:1337/js/controllers.js:34:19) It seems like he doesnt know 'socket', when the enteredUsern...

 
9:16 AM
-1
Q: Node.js and MongoDB Cluster Analsis - K-Means

ShazamI am currently developing a truck delivery web application using Node.js and MonogoDB. I have followed and completed the basic set-up of my system from this tutorial. I have a single web-page that contains a table of data taken from my local mongodb database. It allows users to successfully ente...

0
Q: Failed to create new MeanIO package

mr.dI had encouraged a weird problem when setting up a MeanIO project. I to create a skeleton project, using: mean init myApp I removed all defaults package from the created project, using: mean package -d access mean package -d articles mean package -d system mean package -d users I created a...

0
Q: What is the correct way to create node.js application in nodeclipse using mysql database?

user3811734I am beginner in node.js.I am trying to create application in node.js using nodeclipse.But I can not read my html file in js file it give garbage values. Please help me?

 
9:42 AM
0
Q: cannot post form in node.js express

user3163213I am very much beginner with node.js. There is a sample form with that I am trying to insert values in database- Here is my test page- <form action="/create" method="POST" class="form-horizontal" enctype="application/x-www-form-urlencoded"> <input type="text" id="username_input" name="us...

 
9:54 AM
0
Q: Receiving Ajax POST on Node.js sent by Kendo UI Grid is undefined?

AitorI am a bit stuck when trying to update in the database the data updated in the frontend. I am using a Telerik Kendo UI's Grid to display the data read from Nodejs/PostgreSQL Database. Here is the code of the Grid: <div id="grid"></div> <script> $(document).ready(function () { var ...

0
Q: How do I catch error when creating a ObjectId

GoranIm trying to create an ObjectId with mongoose in my node.js app from the parameters in the route. If I got this route: /product/:id and I try to create my ObjectId for quering the product collection I use this var o_id = moongose.Types.ObjectId(req.params.id); But if the :id part of the ro...

0
Q: Writing a simple standard node module

taufiqueI have written a local node module in a file named a_module.js inside an Express project. To use it from app.js I just use var aModule = require('./a_module'). I know this is not a standard way to write a node-module to use it universally. What is the procedure to convert it as a standard node_m...

0
Q: How less.js work

Joe.wangCurrently I just made the less.js workaround with my site. And it works fine. Let say the code look like below. <html> <head> <link rel="stylesheet/less" type="text/css" href="styles.less" /> <script src="//cdnjs.cloudflare.com/ajax/libs/less.js/1.7.3/less.min.js"></script> </head> <body> ...

0
Q: Node.js Redis lpush error

kevin.desaiI'm making a web app using node.js and redis. I want to push every incoming request into a redis queue before pushing it to a database. But every time the program reaches the lpush command it gives an error. Here is my index.js code, var express = require('express'); var app=express(); var http ...

 
10:20 AM
0
Q: MogoDB with Angular JS without Expressjs and Nodejs

user2156020I want to use MongoDB with Angular JS without using ExpressJS or NodeJS or anyother layer in middle. Regards

 
10:43 AM
0
Q: Node/Express app performance : looking for resources

Ruff9I'm new to Node and Express, and I have performance issues with my first app. I can't find satisfying ressources to learn about that particular subject. I found this very interesting paper : Blazing fast node.js: 10 performance tips from LinkedIn Mobile I'm lookin for more.

0
Q: Nodejs branches test doesn't execute by command "grunt fileName"

Server HalilovI have a problem with my nodejs git branches test. This is the code: var exec = require('child_process').exec; var request = require('request'); var cheerio = require('cheerio'); var async = require('async'); var currentDir = ""; // dir var getBranches = "git for-each-ref --sort=-committerdate...

0
Q: Socket.IO browser javascript library disconnecting when calling a function to update the User Interface

user3802385I am using socket.io on nodejs for a real time update system. Everything works fine. I am using the same browser javascript library for connecting to the socket.io server. On client side my code is : <script type='text/javascript'> var io = new io('http://ws.example.com'); io.on('connect',fu...

0
Q: Call javascript method from nodejs with arguments

u123I am trying to call this javascript myjs.js from command line: function post(path, params, method) { method = method || "post"; // Set method to post by default if not specified. // The rest of this code assumes you are not using a library. // It can be made less wordy if you use on...

 
11:07 AM
0
Q: NodeJs Forever doesnt really start my app

user2572094I run my app using this command line forever start app.js It throws a warning message warn: --minUptime not set. Defaulting to: 1000ms warn: --spinSleepTime not set. Your script will exit if it does not stay up for at least 1000ms info: Forever processing file: app.js It doesnt rea...

 
11:19 AM
-5
Q: looking for a complete node-red tutorial

MukyAre you familiar with a comprehensive tutorial for Node-Red? the http://nodered.org/docs/ is very limited in uderstanding each out of the box nodes

-1
Q: Required Suggestion on best twiiter client for node.js

user3071196Based on search over the net i have found following twitter client's https://github.com/ttezel/twit https://www.npmjs.org/package/twitter https://github.com/jdub/node-twitter https://github.com/AvianFlu/ntwitter My requirement is to connect to the twitter rest api and find user's all activit...

0
Q: Cross error uploading file from AngularJS to NodeJS

colymorei have a problem uploading files from angularjs client to NodeJS server. The error its: XMLHttpRequest cannot load http://localhost:801/bill/send-by-email. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8000' is therefore not allowed acces...

0
Q: Node-Red: How to work with the xml built in node?

MukyI was unable to properly work with the build in xml node. My flow start with injecting an xml string yossi32 and pass it to the xml node. The xml Node transform it to a java script object: (Object) { "person": { "name": [ "yossi" ], "age": [ "32" ] } }, but I am unable to access the attributes. ...

 
11:57 AM
0
Q: Using socket.io in Express 4 and express-generator's /bin/www

user1576978So here is the deal: I'm trying to use socket.io in an express project. After Express Js 4 was lauched, i've updated my express-genrator and now the app initial functions goes into ./bin/www file, including those vars (www file contents: http://jsfiddle.net/avMa5/ ) var server = app.listen(app.g...

0
Q: Break a for loop with promises

Cereal KillerIn my node js App, I have a function that checks if you have the permissions: //queryPermissions is an object that contains all possible permissions: //each property of queryPermission is an object containing the values to be checked for (var key in queryPermissions) { if (queryPermissions.h...

 
12:15 PM
-1
Q: Copying sections of deep JSON objects in node

colsterI've got a big GeoJSON file of the boundaries of suburbs in Australia and I want to just extract the ones in Western Australia. I've got a simple node program to try and do this but I keep getting an output file full of "[object Object],[object Object],[object Object]...." I don't understand wh...

0
Q: Update a "scoreboard" in node js using ajax

Kim JanssensI have been looking for a way to update multiple numbers on a created scoreboard using buttons to increase or decrease those numbers, so you don't have to copy each button function. I think the way to do it is by using ajax, now that I have written the code it still doesn't work. The error I am g...

 
12:32 PM
-2
Q: which hosting provider is the best suited for the following web frameworks

user3312631As i have searched through the internet i have been able to find good sites to buy domain such as godaddy, namecheap ..etc . But i havent been able to know which is the best suitable hosting among services such as aws,digital ocean,linode,dreamhost and other provider for apps / websites based on ...

0
Q: Requiring a node module in Grunt returns null

SamI'm trying to use grunt-rework with a rework plugin (calc). I'm loading it like so: module.exports = function() { 'use strict'; // Rework plugin var rework_calc = require('rework-calc'); return { prod: { options: { use: [ rework_calc ] }, ...

 
12:50 PM
0
Q: How to get uploaded file in Node.js Express app using angular-file-upload

Ajay Beniwal I am new to Node.js and trying to upload file using angular-file-upload. But when i do req.body.files or (req.files) i get undefined value. Can anybody tell me how to get the file which is uploaded through angular-file-upload in node.js express app.

 
1:02 PM
0
Q: Running grunt on windows 8

Alec HewittI am trying to run grunt on an existing project on a windows 8 machine. I've installed grunt-cli globally,by running: npm install -g grunt-cli However when trying to run the project with: grunt I get this error: Warning: Unable to write "preview.html" file <Error code: EPERM>. Use --forc...

0
Q: Raspberry-pi mqttc.publish() to node red overflowing after 20 entries

AnukuttanI am using my python code to publish messages to node-red via mqttc. The problem is after 20 mqttc publish,the data is not getting published to nodered. Here is the python code i used for posting to node-red. mqttc.connect("nodered&mqtt_server_ip",1883) i=1 while True: i=i+1 mqttc.publi...

0
Q: angularJS + socket.io: Only working one way

user3811661I have a problem with angularJS + node + socketio. In my application its possible to send data from client to server via socket.emit('enteredUsername', 'Guest'); like in controlls.js. But it doesnt work from server to client. After the server receives 'enteredUsername' he should emit 'UsernameOk'...

0
Q: Nodejs Module version mismatch. Expected 11, got 1

Masiarafter updating NodeJS to v0.10.29 I got the following error: Error: Module version mismatch. Expected 11, got 1. at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Module.require (module.js:364:17) at require (module.js:380:17) at bindings (/home...

0
Q: Translate Node in Python

BenI want to translate this Node code : var header = new Buffer(4); header.writeUInt32BE(buf.length, 0); this.stream.write(Buffer.concat([header, buf])); in python. I try this : header = buffer(struct.pack('>I', len(buf))); scc.send(buf+buffer(buf)) but it doesn't work. Can you help me pleas...

0
Q: What about the node.js-oracle combination?

user3796870I'm starting a web project in which I want to use node.js. The project requires to use Oracle as a database management system and to work on Windows plateform. This project aims to send pl/sql request to establish some statics. Does the use of node.js is the best choice?

0
Q: Very slow mongo query

GoranI got a modell like this in node.js / moongose app for my matches. var MatchSchema = new Schema({ race: { type: Number, required: true}, type: { type: Number, required: true}, path: { type: Number, required: true}, track: { type: Number, required: true}, ...

0
Q: Node-Red: working with CSV Node

MukyI am sending a csv file: A1,A2,A3,A4 B1,B2,B3,B3 to a csv node with 4 columns (A,B,C,D). I am able to see the first csv record as a JS Object, but I wasn't able to access the rest of the records. the csv node output look like this: (Object) { "A": "A1", "B": "A2", "C": "A3", "D": "A4\r\nB1"...

0
Q: redis in Node.js app environment

AleksI am building an app with several Node.js instances as a Backend (http server, socket server and several a pool of domain servers). Now I am trying to cover several communication and configuration aspects and am wondering if redis makes an appropriate solution. So, I would use it for the followi...

0
Q: socket.io-stream dosn't emit event

user2735468I'm trying to create a file upload through socket.io 1.0.4 and the last version of socket.io-stream. Anytime I try to emit "ss(socket).emit('mediaupload', file);" the event is executed on the client but not called on the server side. I don't get any debug or error messages. If I try to emit the e...

0
Q: How to do a HTTP POST Request that requires authentication using Node.js?

u123I have a simple webserver that requires authentication to perform actions. Now I would like to trigger a single action (pressing a button): my-action through a javaScript, myscript.js, using node.js from command line. I have made this script: var http = require('http'); var request = require('re...

0
Q: Node.js node_modules checked into git with Linux/Unix & Windows developers?

Sunday IronfootA work colleague and I are building a Node.js webapp. I'm running in a Unix environment (Mac OSX) and he's running Windows. The current advice with regards to the node_modules folder is that this should be checked in to source control (git) for apps that you deploy (but not for packages in npm). ...

0
Q: How to get a config from within a controller (require it from a controller)?

GreenI use totally default Kraken.js app. I want to define some configs for .dust templates (select options) in a config.js file. Then I need to get these configs in my controller. How may I get a config in a controller? Here is an example code: 'use strict'; var Post = require('../../models/post');...

0
Q: Nodejs / handlebars is having an issue creating an XML file over a specific size

MithrilhallI'm having an issue generating an XML file. If I run only 20 or so 'properties': properties: properties.slice(0, 20) I get a valid XML file. If I try to run all my properties: properties: properties where I have about 100, my XML is invalid. It's coming back as invalid because of a random XML el...

 
2:12 PM
0
Q: run JS on server side node and load at EJS file

Jessica ThedocSo I have an large script in a EJS file and I need to run this on server-side. How would I do this in nodejs? I am a complete newbie at this, I was think if I could set the script on a js file and then load it by its name in the EJS file. If there's any way, the best way to do this could anyone ...

0
Q: Passport.js user login authentication using redis

user2717352I'm having a trouble using passport.js (passport-local) with express and redis and I can't find any solution for this. I don't have any idea how to do this with redis. There's a lot of example there in the internet but the examples is all about mongo, well I prefer to user redis than mongo. Btw g...

0
Q: Can I run multiple node.js files

wazzadayI have a server.js file which runs my server and displays html files. In a client side javascript file I would like to make an ajax request to a separate server side js file which pulls in data from an API. Is this possible? or is there a better solution when working in a node environment.

 
2:54 PM
0
Q: Error: ENOENT - Program node server.js exited with code 8

dbexternalHaving a tough time with this one. While running my node app on OpenShift, on a request I get: GET / 200 112.394 ms - - events.js:72 throw er; // Unhandled 'error' event ^ Error: ENOENT, open '/var/lib/openshift/53b9410ce0b8cdd72900006b/app-root/runtime/repo/public/system/lib/...

 
3:06 PM
0
Q: difference between req.url and req.originalUrl in expressjs version 4

user2452057I am trying to implement login feature in an expressJS version 4 app. I need to determine whether an user is logged in before he can do certain actions. So I have a middleware called as isLoggedIn which solely checks if user object is in session, if not, the user is redirected to login page. Afte...

0
Q: sequelize.js N:M through relationships, delete cascade

BillI am using Sequelize.js v1.7.9. With Express.js 4 I have the following relationships: User hasMany UserRoles User hasMany Roles through UserRoles UserRoles belongsTo user UserRoles belongsTo role Role hasMany UserRoles Role hasMany Users through UserRoles In Rails, we can simply say depende...

 
3:18 PM
0
Q: Attempting to use redis for express-session for Express v 4.0.0 - Keys * shows an empty list

user3010587I am working on an API which receives HTTP requests and responds with a JSON object. I am looking to provide authentication to save an extra database call to confirm login credentials. I have the following environment: Node.js Express v4 express-sessions (installed) redis (installed) connect-...

0
Q: Push Notifications: How to know if the client connected from which device?

user3492113I trying to build push notification server using socket.io, expressjs and mongodb. The server function is sample as receiveing massages and then push them to group of clients(subscribers). The server works fine if all clients are online but my Problem is if the client is offline how can the serve...

0
Q: illegal instruction running node.js in pentium2

låzaroafter unpack my correct arch packgas in linux; and exec node it say: Illegal Instruction and not run There is and strace: https://gist.github.com/anonymous/cd4073637df7672dfff1 an there is my cat /proc/cpuinfo: https://gist.github.com/anonymous/21e11d8f6e4d5c6adeb0

0
Q: scalable broadcast message using socket.io

Rodrigo FonsecaI´m using socket.io in one project here, it´s working fine, no problem, but the question is, if i had more than one million of users(or maybe more than that) what will be the cost to my server to broadcast a message of 60kb to all of them?

0
Q: How is this npm switch fixing Windows path length issues

McDonnellDeanOn Windows NPM has issues due to its deep nesting of dependencies. In order to fix this a friend suggested the following command npm install <dep> -g --no-bin-link The man pages say about this command The --no-bin-links argument will prevent npm from creating symlinks for any binaries the pack...

 
3:50 PM
0
Q: Box api call to fetch the access token is failing in node.js

PratsI wrote a program in node.js to fetch the access token to call the box apis, unfortunately I am getting an error "invalid_client" which is either "client ID or secret are wrong" as per the documentation. I am pretty sure that both client id and secret are correct since it worked fine for me while...

0
Q: AngularJS its send file a body and not in file

colymorei have an angularjs service to send a file to a NodeJS server. This is the code: define([], function () { "use strict"; var UploadService = function (API_URL, $http) { var uploadFile = function (file, uploadUrl) { var fd = new FormData(); fd.append('file...

 
4:11 PM
0
Q: How do I add angular to an express.js page?

GianthraI've created a Meanstack project and I cant figure out how to add the AngularJS files from the npm package into the page... Am I supposed to manually find the files and add them the old fasioned way in a ? If not where and how do I add it? Screenshot is for clarification on my position. Scre...

0
Q: Node.js Mocha testing with transactions

BillI was wondering, how is it possible to test a Node.js (Express.js) API web server with unit tests and transactions? We have some seed fixture data, and we are reseeding that data for EVERY SINGLE test. Coming from a Rails background, everything is done synchronously. However in Node.js everythin...

0
Q: Stopping the middleware chain in express4

Talespin_KitBelow is the code which has a middleware function "checkLogin" added. The eheckLogin middleware should redirect to login page if the user is not logged in. If the user is logged in it should render the requested page. var express = require('express'); var router = express.Router(); var mongoUri...

 
4:23 PM
0
Q: how does exports statement evaluated in node.js?

user3813144below is snippet from node url module source. var punycode = require('punycode'); var util = require('util'); exports.parse = urlParse; exports.resolve = urlResolve; exports.resolveObject = urlResolveObject; exports.format = urlFormat; exports.Url = Url; function Url() { this.protocol = nul...

 
4:57 PM
0
Q: Lineman.js - tasks/server.coffee not being used

dmanUsing Lineman, I am trying to trouble shoot some Express.js configurations. I have been editing tasks/server.coffee but it does not seem to effect Express. I then removed the tasks/server.coffee completely and express.js still runs and servers pages with no issues: Running "server" task Starting...

0
Q: Best practice to hang on to variables when using Promises

AmberlampsI am new to Promises and I was wondering what the best practice is to keep variables while going down the chain? Connecting to MongoDB via Promise is pretty straight forward: connectToMongoDB(data).done(function(db) { var collection = db.collection('test_inserts'); // do more stuff her...

0
Q: Failed to lookup view with Express + jade + angular

AvelineLike so many before me I am getting the following error: Failed to lookup view "/partials/test" in views directory "/home/aveline/git/multivision/server/views" Since I am using Jade, my templates get rendered through app.get: app.get('/partials/:partialPath',function(req, res){ res.ren...

0
Q: UnitySocketIO sending a websocket message to nodejs

Dennington-bearJust wondering if anyone has used the UnitySocketIO to chat between unity and node.js. I want to send a message but the documentation is lacking and everyone has a different way of doing it without explaining key aspects to setting it up. In Unity(C#) i set it up like this: using UnityEngine; ...

0
Q: module.exports with object

Su4pI'm starting with node.js and javascript server side. I think, maybe I got confused with the module.exports thing. And I'm pretty sure it's a noob issue. I'm trying to do a simple task : oAuth - controler [oAuth.js] module.exports = function() { return { tryLogin :function(Username,Pas...

0
Q: NodeJS Buffer read bits from Bytes

Lee ArmstrongI have the following example buffers and trying to extract some data from this. <Buffer 38 31 aa 5e> <Buffer 1c b2 4e 5f> <Buffer c4 c0 28 60> <Buffer 04 7a 52 60> <Buffer 14 17 cd 60> The data is in the format Byte 1 - UTC nanosecond LS byte Byte 2 - UTC nanosecond Byte 3 - UTC nanosecond ...

 
5:34 PM
-1
Q: Meteor app using subdomain for user accounts

rmolinaresI'm writing an app using Meteor for company inventory management. Each company will get their own subdomain, but essentially they'll all be using the same code & routes, the only difference being that depending on the subdomain the subscribe/publish/log-in will be unique to that subdomain. For e...

0
Q: Calling Event 'socket' in http.ClientRequest

user2135737I am a node newbie and have a question about the socket event in http.ClientRequest. The documentation says Event: 'socket'# function (socket) { } Emitted after a socket is assigned to this request. URL: nodejs documentation I have the following: var req = http.request(requestOptions, funct...

0
Q: PDF File its corrupted in NodeJS

colymoreim sending a PDF file and getting it in req.body in NodeJS, the req.body starts with this: %PDF-1.3 and end with 0000001041 00000 n 0000001134 00000 n 0000001226 00000 n 0000001320 00000 n 0000001418 00000 n 0000150613 00000 n 0000150725 00000 n trailer <

0
Q: How to export a Node.js module requiring assignment

Aobo YangMy case is that I need to require a module named Router in my index file meanwhile assign value to a variable of the module. I have figured out several ways to achieve it. However, as a beginner, I want to know which one is the best practice or design and why cannot use the others. Method 1 - e...

 
5:56 PM
0
Q: NSTask node --version not working

user3813443I'm using NSTask in xcode to try and find the version of node js the computer is using. Here's my code: NSString *runCommand(NSString *commandToRun) { NSTask *task; task = [[NSTask alloc] init]; [task setLaunchPath: @"/bin/bash"]; NSArray *arguments = [NSArray arrayWithObjects: ...

0
Q: Alternatives to connect-ensure-login

Talespin_KitI want to use the https://www.npmjs.org/package/connect-ensure-login, but the last commit seems to be a year ago. Is there any competing node module to it. I just want to provide only local authentication. Passport http://passportjs.org/ seems to be popular but can passport support local authenti...

 
6:16 PM
0
Q: Parse JSSDK deleting object by id

Justin ErswellI am trying to delete an object in cloud code and I have this function in my controller. exports.del = function(req, res) { var post = new Parse.Query(CCPost); var objectId = req.params.id; post.get(objectId, { success: function(myObj) { // The object was retrieved successfully. ...

0
Q: How can create a mongodb query object using variables in nodejs

user3813509The query works in mongo console : db.blogs.find({title : /fun/i}); but I tried to use it in nodejs, it won't work if I do it as : var keyword = "fun"; query = { "title" : "/"+keyword+"/i" }; //doesn't work query = { "title" : /fun/i }; //works, but I need to use the variable name -...

 
6:57 PM
0
Q: MEAN correct way to refactor ejs express code

user3783804I've created a website with express and ejs, pulling JSON in from a file in a local file. I'd like to pass the data in from a mongo database and display with an Angular view. I have a good amount of knowledge in express, angular and mongo. Putting it all together and separating the express tasks ...

0
Q: Why I have to use 'include' again in grunt-requirejs to optimize into a single js file?

toyI'm trying to use grunt-requirejs to optimize my requirejs project into a single production js file. However, I'm not sure if my Gruntfile.js is correct because I have to specify which model to include during the optimization again, which seems wrong to me as I specify mainConfigFile already. I t...

 
7:16 PM
0
Q: add_response format limesurvey

Stephen StuckyLimsurveys API says this: Using this function you can add new responses to your survey response table. Parameters: sSessionKey (string) - The session key iSurveyID (integer) - The survey id aResponseData (array) - array/structure containing your response data Returns: On success: response_id (...

0
Q: Sharing code between node js project and a web site project

JCafeSo I started coding a chess engine in typescript as a side project. I initially intended it to be a CLI like most other chess engines that interact through stdin and stdout. This so I could plug it to a GUI like Arena and test it against other engines. For that I decided to do it as a node projec...

 
7:50 PM
0
Q: Mongoose save() not updating value in an array in database document

Suleman MirzaI am trying to update a document in a collection (units) using GUI and after it gets updated I want to update the value (user.Units which is an array of Unit names) in collection (users). If the array length is just 1 element it gets updated and also shows up in database and everything works wel...

 
8:19 PM
0
Q: Amazon OpsWorks NodeJS environment variables

JuljanI configured a stack for a NodeJS application server using Amazon OpsWorks. I need to access some environment variables which define Google API credentials. How can I achieve this ? I already spent more two days on this. I ended up by the following chef recipe : magic_shell_environment "GOO...

0
Q: While rendering html+js page in node.js using jade, getting html as text rendered instead of the html

BKSinghI am trying to render an html+js page in nodejs using jade. I used the online available html to jade converters to convert my html to jade and then render it from my nodejs app. However, I am not able to render the jade properly. The example that I used is the one provided by google in their doc...

0
Q: Where are Mocha's API docs? Is the Mocha API only

ChrisI thought I was missing something, but I can't find anything. What I've found so far: assert and assert.* are from Node (docs here) Mocha lists TDD, BDD, exports, and QUnit-style interfaces. Are those ~10 functions actually the only API belonging to Mocha itself?

 
8:31 PM
0
Q: Making gulp write files synchronously before moving on to the next task

asolberggulpfile.js gulp.task('browser-bundle', ['react'], function() { ... }); gulp.task('react', function(){ gulp.src(options.JSX_SOURCE) .pipe(react()) .pipe(gulp.dest(options.JSX_DEST)) }); As you can see I have the browser-bundle task depending on the react task. I believe this w...

0
Q: Set array element to null with Mongoose

meriadecI'm encountering an interesting problem, trying to set to null an element of a sub-array in mongo with mongoose (wich seems ridiculously obvious, yep). My data look like : { _id : ObjectId("53bafbfd00cbcc3a1178e11b"), name : "item 1", slots: [null, null, ObjectId("53baf297d63228631029d2f...

0
Q: NodeJS Javascript for loop changing contents

Lee ArmstrongI have the following code that iterates a Buffer looking for a packet end marker. There could be several packets within this Buffer object so I am using the packet markers to find the data, process it and then move onto the next one by slicing the buffer. I am however missing packets as my cond...

0
Q: Connect openshift application to noobhub client

TomI'm using noobHub with corona sdk with my local server and it works fine, but when I put the server online (to my free openshift account) I can't connect the client application to it. On the server side I have to set up the ip and port like this: var port = process.env.OPENSHIFT_NODEJS_PORT ||...

0
Q: Read newest csv records with Node

Chris MattaI'd like to watch a CSV file and get the newest records since it was changed. I'm running the following shell command to build a very simple csv file and append a new line every second: rm test.csv & x=0 && while true; do echo "${x},${x},${x}" >> test.csv; x=$(($x+1)); sleep 1; done The followi...

 
9:00 PM
0
Q: There is any library to manage (archive/delete/read/write) my gmail account with node?

fuxesI'm looking for making an online email client with MEAN framework (MongoDB + Express + Angular + Node), i.e. my own gmail client with custom made features. For that I'm searching a node library that helps me to manage an gmail account. So I need be able to fetch, send, label, delete, archive,cre...

 
9:26 PM
0
Q: Serial port communication between Nodejs and Arduino

user1574779I am trying to communication between Arduino and Nodejs. But problem is when I communicate between I got correct reading as well as some garbage reading in between correct reading. Still cant understand how to resolve this problem ? Here is the Nodejs part which is used to read data from COM ...

0
Q: Asynchronous Iteration of Array of JSON

philipxjmI'm using Node.js with MongoDB, to be more specific, MongoLab and Mongoose. In the DB, I have two collections, pours and users. A user object would be linked to multiple pour objects with a shared cid. I need to iterate through an array of user objects. But for loop somehow doesn't work with as...

0
Q: MongoClient periodically recreates connection after ReplicaSet disconnect

user3562291I'm running into a strange issue when using the node-mongodb-native driver for MongoDb in node.js. I'm connecting to a replica set using code similar to the following: var options = { server: { auto_reconnect: true }, db: { native_parser: true, bufferMaxEntries: 0 } }; var url = 'mongod...

 
9:38 PM
0
Q: node.js pusher/slanger How to emit depending the requester

TMichelIn node, when a client POST, i emit a message: slanger.trigger('someonePosted', 'success', data); Is possible to emit one slanger message to the user making the POST petition and a different message to the rest of the clients?

0
Q: How do i setup SMTP with Loopback.io

user3155632How to setup SMTP server with loopback.io mbaas? i have gone through all the documentation but i couldn't find it. How to give/define my smtp server settings in loopback config file if there is way to do so.

 
10:02 PM
2
Q: How does node "actually" handle threads?

GustavI read a lot about node js trying to understand the event loop and its patterns / anti patterns. One thing that many authors fail to mentions that node actually handles threads. The application programmer however doesn't get access to them of course, but it's nice to know that they exist and when...

0
Q: gulp-sass error: Unhandled stream error in pipe

SDPI'm using gulp-sass and I get the following errors: ESL@eslmbp /Applications/MAMP/htdocs/craigpomranz[master*]$ gulp sass [17:54:53] Using gulpfile /Applications/MAMP/htdocs/craigpomranz/gulpfile.js [17:54:53] Starting 'sass'... stream.js:94 throw er; // Unhandled stream error in pipe. ...

 
10:20 PM
0
Q: Including and grouping related functions in js files in Node Express

p.campbellI've got a Node Express route file. It was getting large in its number of functions that weren't route related - code to hit Azure and other file name related functions. I'm fairly sure I want to keep routing functions in the route file (here it's route/tally.js file, and functions for file name...

0
Q: Why is Node.js executing in this manner?

Abe MiesslerI have a Node.js application that I am using to migrate records from MySql to MongoDB. I am using Mongoose and async.js, to do this and I have noticed some behavior that I do not understand. If I have the following Coffeescript code (javascript here): # users is a collection of abou...

 
10:50 PM
0
Q: Node Inspector not showing my Node application

J4GI've followed all the steps for using Node-Inspector But when I open up the application, I can't see any of my scripts or logs to the console. My app is running on port 4000. The only thing I thought that might be conflicting is WAMP on port 8080 as well, but changing Node-Inspector's port...

0
Q: Node.js run as program vs php

EvilsantaI have been looking at the node.js application vs php, I found many comparisons comparing these two server technique. Mostly people suggest that the javascript V8 engine is much faster than php in terms of running speed of a single file calculation. I worked on some javascript code for Node.js,...

 
11:13 PM
0
Q: Why is Spotify botching my Node Component builds?

shennanCan anyone think of any reason why my Component custom builds might be failing every time (seemingly without fail) my Spotify application is open? I have noticed varying errors, but this is the most common. error : Command failed: Error: UNKNOWN, unknown error 'path/to/component.json' at O...

0
Q: Capturing Global Keyboard Events On Linux With NodeJS

Wasabi FanI have a headless Debian ARM machine that I'm running Node on. The device has hard buttons that are mapped to normal keyboard events using gpio-keys. My goal is to capture the global events from both the hard buttons as well as any attached keyboards in Node. I need a solution that can capture t...

 
11:25 PM
0
Q: Run function/code after certain time with nodejs

JerryFoxI am looking for a way to run some code in nodejs after N amount of seconds. Tried setTimeout() but it seems to completely block on it until the time is out but this is not what I want since my server is still sending and receiving events. Any advice?

0
Q: NodeJS Error: code=ECONNREFUSED, errno=ECONNREFUSED, syscall=connect

d9120I am having an issue with my node sever. Today I had to switch Linux boxes. So I've switched hard drives and copied over my old profile to the new one everything was working good until I started my node server but I am getting the following error: code=ECONNREFUSED, errno=ECONNREFUSED, syscall=c...

0
Q: How to parse open event parameter on node-webkit?

shujiI need an array with all the arguments like the value in gui.App.argv Is there some function included to parse this? function openfile(cmdline){ console.log('command line: ' + cmdline); } openfile(gui.App.argv); //my file.txt, my file.txt (this is what I need) gui.App.on('open', function(cm...

 
11:49 PM
0
Q: How can I be sure stream event listener processing is not being duplicated?

BigMarioI'm using the twit Node library, and I've just started using Node.js & Socket.io. I've read some of the Node.js Stream documentation, but I want to be sure I understand this correctly. In twit, I can create a stream of tweets from the Twitter API using this code: var stream = T.stream('statuses...

 

« first day (51 days earlier)      last day (26 days later) »