« first day (13 days earlier)      last day (64 days later) » 

12:10 AM
0
Q: Express REST API - Delete Method

Sizzles27I am getting stuck on the delete method for my API. My application requires a user to log in and then he can add courses. The courses are stored in a nested array inside the User model. I want the user to be able to cancel (delete) a course from the view and then have the course deleted from the ...

0
Q: AngularJS RouteProvider and ExpressJS conflicting routes

user2669464In my Angular app, I'm trying to render partials that load into the index page when a user clicks a link. It worked fine before with the following code: //app.js in Angular angular.module('myApp', [ 'ngSanitize', 'ngRoute', 'myApp.filters', 'myApp.services', 'myApp.directives', 'myAp...

 
12:39 AM
1
Q: Deploying Express app to Heroku

user1775500I am trying to deploy my express application to Heroku but I keep getting the error that "Push rejected, no Cedar-supported app detected", but I made sure to define the package.json and the Procfile from the tutorial using npm init. Here is my package.json file: { "name": "ClassMatch", "ver...

 
1:22 AM
0
Q: AndroidAsync Socket.io ignoring server timeout settings

user3689636We're using AndroidAsync for Socket.io and are generally extremely happy with it. But to provide a good user experience, we need it to detect network failures fairly quickly. Out of the box, it takes a minute or more. As I understand Socket.io, the timeout is set on the server and communicated to...

0
Q: Returning a concatenated string from callback nodejs

respectusHi I'm new to nodejs and I'm having trouble with returning a string of lyrics from metrolyrics.com. The lyrics are stored in separate paragraphs and I'm trying to return a string with all the paragraphs connected. I looked up some resources online and saw that I had to use a callback function, bu...

 
1:53 AM
0
Q: Working with express.io in a seperate router file

Sooyong KimI'm trying to use the router and socket.io together. I've created a seperate router file and try to conjunct the route and socket.io app = require('express.io')(); //var app = express(); //var router = express.Router(); app.http().io(); var mysql = require('mysql'); var connection = mysql.cr...

0
Q: Calculating Time Diference between 2 working hours Javascript

user3689702Does anyone have a way to calculate the time in hours between 2 dates, taking in account i would like to calculate only working ours, In javascript, i'm developing a Helpdesk system in Node.js. This would have to not add offwork hours, weekends and holidays. Example Working hours from 8:00pm t...

 
2:16 AM
0
Q: Cannot read property '_id' of undefined using mongoose

abhishekFollowing is the code which i am trying to run :- poolModel .find({}) .exec(function (err, pools) { if(err) return next(new customError.Database(err.toString())); for(var i=0; i<pools.length; i++) { poo...

 
2:34 AM
0
Q: Bootstrap 3.1.1: I can't import all the bootstrap .js files, how is "= require" supposed to work?

VennsohI am using the latest Bootstrap v3.1.1 Sass. Within the .zip file, I get lib, tasks, templates, test and vendor. I ignored everything and only use the vendor > assets folder. The assets folder has all the fonts, stylesheets and javascripts I need. I have gotten the file structure setup proper...

 
3:06 AM
0
Q: can you access a mongoose created database from mongo?

ChrisMcJavanoob node.js, Express and MongoDB here, running on Ubuntu 14; I created a mongoose in an express/nodejs app database via: var mongoose = require('mongoose'); var express = require('express'); var app = express(); ... mongoose.connect("mongodb://localhost/firstExpress"); var UserSchema = new mon...

 
3:46 AM
0
Q: Socket.io bad request with response {"code":0,"message":"Transport unknown"}?

JVE999I'm trying to run socket.io and I'm getting a bunch of these: http://domain.com:8080/socket.io/?EIO=2&transport=polling&t=1401421022966-0 400 (Bad Request) This is the response I'm getting: {"code":0,"message":"Transport unknown"} I can't find any reason. I read somewhere that it might be ...

 
4:16 AM
0
Q: [Error: failed to connect to [localhost:27017]] . This error is occuring On mongodb

JumabekMy sample code is here. I am learning from book developing_backbone.js_applications I have installed mongodb on my PC. I searched for it on this site with answers but no clue. has anyone got any solutions? Thanks! // Module dependencies. var application_root = __dirname, express = require(...

 
4:45 AM
0
Q: How to use GeoSpatial qry.where().near() with coordinate pairs in mongoose.js

Steve LorimerI am unable to query a mongodb database using mongoose's qry.where().near() syntax. I have a Schema with coordinates stored as an array, indexed as 2dsphere: loc : { type: [Number], index: '2dsphere' } I am running a mongoose query using .where().near(): qry.where('loc').near({ center: s...

 
5:09 AM
0
Q: How to use MongoDB documents in latex template?

ABarikI am creating a pdf file from latex template, i have successfully compiled template file(.tex) to pdf with static value of template now i am going to use my data which are got from mongo, but i didn't understand how to put it in latex template. If you have idea then share it. Here my code var sy...

 
 
2 hours later…
6:42 AM
0
Q: Dockerfile build error on RUN npm install

SandyRunning docker build, using a dockerfile to build that image but getting error on npm install dockerfile : # Download Runnable-web Repo RUN eval $(ssh-agent) > /dev/null && ssh-add /.ssh/id_rsa && git clone git@github.com:CodeNow/runnable-web.git WORKDIR runnable-web RUN npm install RUN bo...

0
Q: Error: listen EACCES when deploying a very small node.js server on openshift

JocheThe EACCES error is very common and I have read and tried all of the questions here on stackoverflow, but I'm still stuck. This is my server code: var ipaddr = process.env.OPENSHIFT_NODEJS_IP || "127.0.0.1"; var port = process.env.OPENSHIFT_NODEJS_PORT || 8080; var express = require("expres...

0
Q: Continuous integration and deployment of Node.js application on Bamboo

FerhadThe application I want to implement continuous deployment on Bamboo has node modules and bower component dependencies. On the bamboo server nodejs, npm have been installed. There are only three tasks on default job: Source Code Checkout Build dependencies: npm install bower install Deploy to...

 
7:14 AM
0
Q: Postgresql9.3 query optimization

SubburajI am using postgresql 9.3 in my node.js application. In my database i have some 7lakhs records now. Also in my database i have json datatype column. My query is as following: EXPLAIN ANALYSE select id_0, name_0, id_1, name_1, id_2, name_2, id_3, name_3, id_4, name_4, latitude, longitude, to_c...

0
Q: Cannot GET error while returning response

NeilI am creating a script using node.js,fbgraph api and express framework. I POST access_token of user from a page index.html on nodejs server. I am able to retrieve the access_token and I used the fbgraph api to retrieve further user info. But when i try to send the response Json object i am gettin...

 
7:26 AM
0
Q: TypeError: Object #<Namespace> has no method 'clients'

user77005I am new to node.js. I am trying to use webrtc to build a chat app and im using node.js as the remote peer. When ever I bring my application the server stops with the following error. How can I resolve it? TypeError: Object # has no method 'clients'

0
Q: swig js filter "last"

Helvdansource json: { "rss": { "$": { "version": "2.0", "xmlns:metadata": "http://rss.rbc.ru/metadata", "xmlns:rbc_news": "http://purl.org/rss/1.0/modules/content/", "xmlns:wfw": "http://wellformedweb.org/CommentAPI/" }, "channel": { "item": [ ...

 
7:43 AM
-1
Q: I am using mean fullstack when i created new package and doing add functionality it gives following error

user3690089Error: Assignment is not a constructor $scope.create@http://www.mydomain.com:3000/modules/aggregated.js:510

0
Q: Parameters passed to SOAP webservice(in java) receiving as null when called from node.js

user161091This is my node.js code. I am trying to call two soap webservices, WhetherInterested and PointInPolygon which are written in java. Since it is expecting four parameters, vehicleId(integer), lat(double), lon(double) and packetTime(calendar), i created those java objects in node.js using the node-j...

 
8:01 AM
0
Q: mean.io assetmanager.init(... returns JS error

Mihail BurdujaI want to use MEAN.io stack. I did the required initialization. Created the folder, did the npm install, got the libraries. now in server/config/express.js I have assetmanager = require('assetmanager'), and // Import your asset file var assets = require('./assets.json'); assetmanager.init({ ...

 
8:12 AM
0
Q: regex node how to make stylish editing a line?

beginner's_luckI have a file in which I have to change some lines that meet a certain rules N1 N2 N3 r where n1 n2 and n3 are the numbers that have value between 0 and 1 (with decimals) e.g. 1 0.67 0 r 0.66 5 high 0 1 0.989 r 0.96 5 slow 0.23 0.345 0.65 r 1 1 1 1 1 1CB 0 0 0...

0
Q: Nodejs app fails to run in Nodeclipse

user3095242I setup Nodeclipse and wrote a simple hello app. When I try to run as a Node Appplication, I get the following error Exception occurred executing command line. Cannot run program "node" (in directory "C:\path\to\app"): CreateProcess error=2, The system cannot find the file specified If ...

 
8:30 AM
0
Q: Closing a Mongoose connection in a script which does not run forever

user3690202I have a JavaScript program which is supposed to run for a brief period of time, insert rows into a MongoDB database, and then exit. Here is the cut down version of the application: var mongoose = require('mongoose'); var models = require('./models'); mongoose.connect('mongodb://localhost/test'...

 
8:48 AM
0
Q: Angular routing for different layouts

TrialcoderHow do I load different layouts ? Currently I have three layouts for my backend, one for admin, one for user and last for teacher i.e adminLayout.html, userlayout.html and teacherLayout.html for dashboards. I am writing my routes something like this - app.config(function($routeProvider){ $...

0
Q: How to bypass the Sails body parser for multi-part form uploads

LoicDpointgroupI am facing a problem on Sails.js (0.9.16) with POST requests sent from a JAVA client. On the client side I built a POST request (with enctype : multipart/form-data) sending a text file. On the server side, I created a controller with a method (action) getRequest which looks like : getRequest:...

0
Q: Show informations one by one

RicoxorMy node.js app aim to scan a list of website an return in a panel, statusCode, and other tests. Now the app work like that : The page is empty until the end of the load and if one website in the list is slow the loading is slow, when 100% of the websites are scan the panel show. How can i show t...

 
9:16 AM
-1
Q: node.js crypto.randomBytes entropy drained

VasiliyI'm using var buf = crypto.randomBytes(16); return buf.toString('hex') to generate unique session tokens for my users. Documentation says: "In other words, crypto.randomBytes without callback will not block even if all entropy sources are drained." The question is: how soon will I get my en...

0
Q: In NodeJS, how to output results from mongodb with different field names?

user3492125I'm using nodejs to query mongodb and want to output json with customized field names. For example, original json from MongoDB maybe {id:1, text:"abc"} I'd like to output it as {ObjectID:1, DisplayText:"abc"}; I understand MongoDB has the $project operator in its aggregate framew...

 
9:42 AM
0
Q: jsdom: Run a page's javascript functions

ronmrdechaiI've been messing around with jsdom and I can't figure out how to run functions from the html page. For example, I've got a simple page like this: <html> <body> Hello </body> <script> function test() { document.write("Bye bye") } </script> </html> And I'd like to exec...

0
Q: Why is my callback being sent as a string?

JVE999I'm sending in a callback to a javascript function and for some reason it's receiving it as a string. I'm using node.js, if that matters. execProg('runCheck','data=data1', function (error, stdout, stderr){ console.log("isWorking"); }); execProg = function (args,callback){ v...

 
10:01 AM
0
Q: Require files with scope

superzampIs there a way to give a scope to a file loaded with require node.js ? For example: main.js var scope = { message: "Hello World", }; require('./echo.js', scope); echo.js console.log(message); Obviously this doesn't work. I know i'm supposed to use module functionnalities, but this i...

0
Q: SailsJS + Waterline concurrent db requests with promises

veturiI'm a bit confused about concurrency in SailsJS's waterline. Currently I'm doing data retrieval like this; var results = {}; // Get user by id 5 User.find('5', function(err, user) { results.user = user; // when it resolves, get messages Message.find({userId: '5'}, function(err, messages)...

0
Q: jwt-simple won't decode token from x-token header

JorreI'm using JWT-simple in a node.js app for token validation. var token = (req.body && req.body.token) || (req.query && req.query.token) || req.headers['x-token']; var decoded = jwt.decode(token, jwtSecret); This works when posting the token. However, when I set the same token as a x-token head...

0
Q: SailsJS to Phonegap?

cartoonleI'm trying to create a Phonegap project from SailsJS project. As i found out so far, command "sails build" should generate www folder with files to import to Phonegap. I've tried that, but i get www folder without index file, views,.. It looks like custom grunfile is needed to get appropriate www...

0
Q: Mongoose : How will I get 5 random records with 5 different conditions?

Prasanth BendraMy model : Question (Only data relevant to question are given all other things are removed) exports = module.exports = function(app, mongoose) { var questionSchema = new mongoose.Schema({ difficultyLevel: { type: String, enum: ['easy', 'medium', 'hard'] }, questionT...

0
Q: Removing gulp.src files after gulp.dest?

XåpplI'-I0llwlg'I  -I have a scenario where a client of mine wants to drop LESS files into a src directory (via FTP), and for them to be automatically outputted as CSS to a build directory. For each LESS file, once its resultant CSS file is created, it should be removed from the src directory. How can I do this with...

 
10:37 AM
0
Q: How to start/stop NodeJS server only once when running test suites

Hoan NguyenI'm writing selenium test suites for NodeJS. Here's one sample test file: var Sails = require('sails'); // create a variable to hold the instantiated sails server var app; var client; // Global before hook before(function(done) { // Lift Sails and start the server Sails.lift({ log: { ...

0
Q: Return a list of all rooms this user is in in socketio 1.0

Andrus AsumetsI'm migrating from socketio 0.9 to 1.0 and I couldn't find an equivalent function to "io.sockets.manager.roomClients[socket.id]" in 1.0. Does anyone have an idea?

0
Q: Migrating socket.io from 0.9.x to 1.x, Problems with configuring RedisStore

c.hillSo I am migrating my node application from socket.io 0.9.x to 1.x, and I am having issues with configuring the RedisStore. I had this working when using 0.9.x, but I can't figure out how to get it working with 1.x. The documentation appears to only work for 0.9.x. Here's the relevant portion from...

0
Q: How to create mongo schema with first name of field using character '$' dollar sign

user1450570I want to send data to mongo and an api endpoint. The json format that used by another api is like below : { "$type" : "$create_account", "$api_key" : "a167abc7760c6dc3", "$user_id" : "INSERT_USER_ID", "$user_email" : "acapone@gmail.com", "$time" : 1352329200, // Supporte...

 
11:21 AM
0
Q: Winston Logging - separate levels to separate Transports

sisyphusI am using Winston for logging with 2 different transports - File and MongoDB. I have set the level for File as "INFO" and for MongoDB as "ERROR". If I now log, log.info('some info...'); log.warn('some Warning...'); log.error('some error...'); All of these would go to the LogFile, and only Err...

0
Q: node.js with redis (hiredis) get error

user2024300I'm using node.js with sub to receive in real time all message from channel "live". I't work fine, but after 10-20 minutes of use i get error: events.js:72 throw er; // Unhandled 'error' event ^ Error: Ready check failed: Redis connection gone from end event. at RedisCl...

-2
Q: Node.js and ASP.net? Whats the difference

user3691064I am exploring the latest technology called "Node.js". Can anyone please let me know few things: 1)What all things Node.js is capable of doing that ASP.NET was doing earlier and can be replaced with Node.js . 2)What all things Node.js is currently lacking which are in ASP.Net and cannot be repla...

0
Q: weird exec issue - stdout not showing - callback not working

Melbourne2991The odd thing is this same code has worked previously. It seems that when I run the below now, I get no callback. None of the console logs work. However if I run "ls" instead of mongo for example it works fine, similarly if I write something like mongod -gfsssl (which should show an error) I do i...

 
11:44 AM
0
Q: Node.js Request timeout

MikeI'm using Node.js to write a sip server. When a call is made to the sip server it works as expected. That is, it gets the caller's number and posts it to a PHP script using a Node module called Request. However, after a number of minutes the connection timeouts. I've tried setting the timeout opt...

0
Q: Nodejs: How can i simply get the request body using express4?

ThariamaNow that express is not shipped anymore with middleware that filles the req.body variable i am fighting to get req.body filled again. here my code app.post('/xyz/:object/feedback', function(req, res) { console.log('Feedback received.'); console.log('Body: ', req.body); // is not availa...

 
12:09 PM
0
Q: Access private function in Node Module

binarygiantI have a function exposed through export in a node module I'm building. I'd like to be able to have that function call an internal (private) function within the same module. So far I have something like: someModule.js var publicFunc = function(a, b) { var obj = {result: 'of some process...

0
Q: Access instance variables from within object attached to prototype

elimenceI need to group instance methods into an object before attaching to the protocol But when I do that, this now points to the object and I can access instance variables. Please see the following code for Illustration. var events = require('events'); var Matcher = function Matcher(){ this.list3...

 
12:34 PM
0
Q: How to convert the message in to a json object

sabariI am using a client program called fire packets to fire some hexadecimal data on to a server program in which the server listening on a specified port. The server program works well and it receives the message from the client but need to convert the message into a json object in which results und...

 
12:58 PM
0
Q: Server restarting while uploading video or image on VPS - NodeJS Forever

Avdhesh ParasharI am using nodejitsu's forever package to continuously run my NodeJS(v0.10.28) on VPS. When I tried to upload video or image on server, server stops momentarily and starts again and logging following error: error: restarting script because /path/to/uploadDir/d36eafa413c33eb3f02dcd3782e1e77b cha...

 
1:10 PM
0
Q: Creating a simple oEmbed system in Nodejs

tommyd456For a personal project I'm trying to create a simple oEmbed system using Nodejs. My route looks like this: app.get('/oembed/:url', function (req, res) { oembed.get(req.params.url, function (error, result) { return res.json(200, {message: "OK"}); }); }); where oembed is referen...

 
1:21 PM
0
Q: What aggregation cursor methods are supported by Nodejs drivers?

anvarikAs you know from 2.6 on Mongodb aggregate() operation returns a cursor, however the behavior is a bit different than the normal cursor which returns from a find(). I am using native mongodb nodejs driver, and could not find a proper documentation on available aggregate cursor methods. For examp...

 
1:33 PM
0
Q: Can i debug nodejs web application like .net

psnLoverCSharpI am programmer of .net and currently working in node js using sails , now I'd like to know if i can debug sails project just like in .net (line by line) is there any way to achieve this functionality? Please let me know if there is any way. Note: I am using sublime text editor.

 
1:45 PM
0
Q: Sending files over Nodejs Socket.io

Martijn RiemersI'm trying to send a mp3 file over a socket to the users browser. The mp3 file, which I'm trying to send, is downloaded using request. How do I pipe from a request to a socket and reconstruct the file at the users end? This is my code: io.on('connection', function(socket) { socket.on('downl...

0
Q: Authenticating of the user not working in node.js

user3284596I am very new to programming and node.js. I have this form which I want to authenticate the users when they signup and sign in, but when I run the code it saves the user details in the database as I want but I get this error afterward: Error: Not Found at Object.User.findOne._id [as handle], I ca...

0
Q: Access existing collections using Mongoose

NedI've just started working with Mongoose and I have a question related to accessing existing collections. Let's say I have two separate files, once in which I'm filling the database. I define my collections there, create models and save some data. In second file, I would like to get those collect...

0
Q: Socket.IO Disconnect event not fired up using namespace

user2765735In the Chat example --using namespace (https://github.com/Automattic/socket.io/tree/master/examples/chat) The Disconnect event is never fired up: io.of('/namespaceID').on('connection', function (socket) { socket.on('disconnect', function () { console.log('disconnect'); .... }); }...

0
Q: Rendering HTML/ Cannot Get / node.js error

sinanspdOk guys, when I run my code with node.js and try to open the port on Chrome I get the error "Cannot Get /" instead of rendering the form . There are several questions on this, here but unfortunatly none helps. It would be great if you could take a look at the code and maybe state the problem. Al...

 
2:16 PM
0
Q: Node.js / Redis / Socket.IO performance issues

charlie7My application is as follows Node.js with Express , cluster , express , redis , RedisStore etc The redisclient listens to channels in redis and emits to sockets and this happens at a high rate . I am also using the redisstore . I am pasting the server code and a redisconnection class at bottom...

 
2:40 PM
0
Q: File-based node js paths

Isaac Reid-GuestIs would it be possible for a node js server to have file-based paths for applications, in the same way as PHP/ASP is normally handled. Request Page handler -------------------------------- / index.js /index(.djs) index.js /about(.djs) about.js /about/...

0
Q: Send SSL certificate in javascript GET query

BiribuIs it possible to send a SSL certificate got from a textbox/textarea to a https GET query? I need to make a GET to a server to get a json file and it needs to use SSL certificates in this way. Server is made in node.js, I don't know if it helps.

0
Q: Each event runs on a new thread?

Soroush KhosraviI read an article an it said each callback function runs in a new thread. Is it right ? I confused a bit. Loot at this code: var net = require('net'); var server = net.createServer(function(socket){ console.log('Connecting Connection Connected') socker.pipe(socket); }); server.listen...

 
3:00 PM
0
Q: How to get textarea value and replace it with user updated textarea value

user3691655The code below displays the content of index.html in a textarea. What i'm trying to achieve is that the user can edit the text displayed to him and press "submit" and thus saving the textarea contents in a document. I'm only using Node and Express.. app.get('/edit', function(req, res) { var ht...

0
Q: Updating "expires" with mongoose

GioPanI am new to mongodb and mongoose, and I am having a hard time figuring out how to do the following. I have a Schema, say "User", which includes a field like this: createdAt : {type: Date, required: true, default: Date.now, expires: '4h'} Therefore, when I create a new user, say var user=new U...

0
Q: Apache Cordova, Phonegap - Uncaught ReferenceError require is not defined with external content source

alexpereapI'm new to phonegap - apache cordova development, currently developing an android app but I have a huge problem with my implementation (I'm using cordova 3.4.0) I need to use an external content source, something like http://externalurl.com in the config.xml file. When I do this the site works f...

0
Q: Node express parent folder

MadCookieI am using node and express as a simple html server for my website. Since today my server.js was in the same folder as my index.hmtl so this code was all i needed: var express = require('express'); var app = express(); var path = require('path'); app.use(express.static(__dirname)); app.listen(...

0
Q: Cannot POST forms using Phusion Passenger with Sails.js/Node.js

CaseyWebbI have a site written with Sails.js that I'm trying to deploy to a server with Passenger on it, and so far I'm not having any luck. While all GET requests work, none of the POST requests seem to actually make it to the application. Everything works perfectly without Passenger. Test Controller: ...

0
Q: How to prevent pushing in the document with same attribute in Mongodb

SlayI have the following structure. I would like to prevent pushing in the document with the same attribute. E.g. Basically, i find the user object first. If i have another vid (with is already inside), it will not get pushed in. Try using $addToSet, but failed. I am using Mongoose. This is my Mo...

0
Q: Writing a REST API for Complex Nested Data

SiddharthSo, I'm building an application in Angular which would leverage a REST API at the back, running on Node. I'm having some trouble handling the data complexity while designing this API and could use some help. Here are the different resources, in question. Doctors (each doctor may have multiple ...

0
Q: Getting "Not Found at Object.User.findOne._id" Error in User Authentication in the form

user3284596I have this form which I want to authenticate the users when they signup and sign in, but when I run the code it saves the user details in the database as I want but I get this error afterward: Error: Not Found at Object.User.findOne._id [as handle] and it stops the whole code. I assume that ther...

0
Q: Passportjs and RESTful API

DeepsyI'm building an Angular app via NodeJS and we're using PassportJS for authentication. Till now we support only facebook login and the procedure goes like this: The user clicks Login with Facebook; A popup open with the url mysite.com/auth/facebook The passportjs do it's stuff and redirects to f...

 
3:46 PM
0
Q: Why does the Socket Server stops working?

Olivier Van BulckI am creating a WebSocket for an online game. I have some code that works perfectly, but after a time the server stops the Socket. I don't know what can be wrong and I don't have an error or something. It just stops running. Does anyone know what can be wrong with this code? var mysql = require...

 
3:57 PM
0
Q: Develop/Organize a node module in TypeScript

Johannes KlaußI want to develop a node module in TypeScript, but I'm having some problems with all the possible options to require, import, etc. What I'm doing right now is having every class and interface in it's own file. So I would need to require all the dependencies which is kind of stupid, because I'm t...

0
Q: Sum input integers [Basic Javascript]

DanI want to run a file that adds up the values in the command line. So, node myscript 1 5 10 returns 16. However, it seems that in my code, sum changes into an array variable - somehow. I'd like to know why this happens, and what the correct formulation should be. var array = process.argv; var co...

0
Q: Intercept HTTP responses on an HTTPS server in Node.JS and Express

PSo3GI'm just starting with node.js and express and I'm doing a simple HTTPS server. I've been working with nginx for some time and when I make an HTTP request to an HTTPS endpoint I get a "400 Bad Request" error. However, when using node.js the request never finishes. How can I intercept an HTTP re...

0
Q: npm update includes pre-release

user2811397There is a package, which has a latest version of 2.1.3, and a pre-release version of 3.0.0-rc.7. When I run npm install package -g, 2.1.3 is installed. When I run npm update -g, it updates to the pre-release (which I had installed previously, but removed later). Does npm keep a record of the pre...

 
4:14 PM
hi
 
4:25 PM
0
Q: Calling hubots redis brain in a loop

fullybakedI have hubot running with a custom script for deploying our app code into staging environments. I've added redis-brain to hubot so that we can store who put what branch on what environment. The code works fine to store the data, and the simple request of "whats on envX" works too, but... I ...

0
Q: Add a field to existing MongoDB document (with Mongoose in Node.js)

GBCI have this existing document in a collection Article in MongoDB database: [ { site: 'www.atlantico.fr', date: '2014-05-27T11:10:19.000Z', lien: 'http://www.atlantico.fr/rdv/revue-analyses-financieres/france-apres-decrochage-economique-decrochage-politique-est-engage-jean-jacques-netter-1585173....

 
4:52 PM
0
Q: How to filter result array from node-dir package

user1128939I am using the node-dir package (https://www.npmjs.org/package/node-dir) to list files recursively from a path but I cannot succeed to add a filter to my result. For instance, I want in my result array only files with 'mp3' extension. Does anyone know how I can do that? dir.files(__dirname,...

0
Q: Creating an array with multiple iterations of a single value

PapercornI want to use var foo = _.zip(arrayA, arrayB) in Lo-Dash. All of the values in arrayB are dynamic, however all of the values in arrayA should be the same. The result should always be in the following format: foo = [ ['Mike', 524], ['Mike', 983], ['Mike', 726] ]; I need to create an array of le...

 
5:04 PM
1
Q: how do I close a server in socket.io 1.0?

jcollumThere are dupes of this, but they are for a previous version of the library. It seems that the code has changed. I'm instantianting a socket like so: this.socketLib || (this.socketLib = require('socket.io')); this.socket = this.socketLib.listen(this.port); Elsewhere in the object, I have a ...

0
Q: Differences between Node environment and browser javascript environment

themirrorI've always been a bit annoyed that there are two major realms of javascript projects -- Node and "the browser" -- and while most browser JS can be easily run inside Node with a couple libraries for DOM stuff if needed, porting Node stuff to the browser is usually an afterthought. This all seems...

 
5:20 PM
0
Q: node bcrypt never returns

jveldridgeI am trying to call the Node bcrypt library from within a Mocha test. The following prints "hashing completed" has expected when run from the CoffeScript REPL: coffee> bcrypt = require 'bcrypt' coffee> bcrypt.hash 'hi', 1, (err, hash) -> console.log "hashing completed" But, "hashing completed...

0
Q: NodeJS: Parsing JS objects in C++ addons

Isilmë O.The official doc is here: http://nodejs.org/api/addons.html#addons_passing_wrapped_objects_around I only mean to parse the objects passed in from Javascript, not to pass objects of that type back into Javascript. So I've created a class as follows: class Person : public node::ObjectWrap { p...

 
5:37 PM
0
Q: Mongoose Model returning empty model for property when it should be null

TrevonFirst off, I apologize for the title. It's difficult to accurately sum up the problem I am having in a single sentence. I am using Mongoose 3.8.11 and in my User schema I have a profile_pic property defined like so: profile_pic: { name: { type: String }, url: { type: String } } When I...

0
Q: Is it possible to make the interactive Node.js shell use vi mode?

SahandThis is a minor inconvenience, but since nobody seems to have asked it, here it is: With Python, I can place set editing-mode vi in ~/.inputrc and then the Python and iPython interactive shells will use vi mode. Is it possible to do something similar with Node.js?

0
Q: Processing multiple forms in one page using Mongodb and node.js

user3284596I am having my sign in and registration form both in the same page. I have specified two different routes for posting the data but it saves sign-in form inputs (which are none) when I hit the register button at the end of the registration form? I looked at this question(Multiple forms and one pro...

 
6:05 PM
0
Q: How do I determine why I'm getting 503 errors on my node.js server?

RoccoMaxamasI am currently teaching myself node.js as a hobbyist. I have a server that I was previously able to get to work with simple 'hello world' outputs. However, I think I might have broken something in my node.js server while doing some tinkering last week and it no longer works. Unfortunately, I am n...

0
Q: node.js driver for Oracle without C++ toolchain

wrschneider99Is there a 'pure' Javascript node.js driver for Oracle that does not rely on a C++ toolchain? On UNIX there is no problem, since almost everyone has gcc installed, but on Windows this is a pain.

0
Q: How to reset javascript blob

pufmaigreI'm quite new to javascript and I'm using node.js for a project that needs micro recording. For my purpose I use the WebRTC API. I want the user to be able to record something with his microphone, preview it and then upload if it's a good take. here is my code : var blob = new Blob ( [ view ]...

 
6:28 PM
0
Q: node.js setting a global variable

user3658423I'm new to node js. I searched a lot on stack overflow on this question below, none what I need. I have an app.js file which initiates node server and a router file. I want to be able to store a global value once and shared across other server side .js files which contains my functions. I also w...

0
Q: Update a field, depending on another field, in MongoDB documents (with Mongoose in Node.js)

GBCI have a collection named Article in MongoDB database, with the following schema and model: var articleSchema = new Schema({ site: String, date: String, day: String, link: { type: String, unique: true, index: {unique:true} }); var Article = mongoose.model('Article...

 
6:45 PM
0
Q: How to send messages to a specific client in a chat server application made with nodejs "net" module?

user3603880My server uses a common room in which you send a message and this message arrives to all the clients. Now I am thinking about sending messages to just a specific client. I am using the net module to make the nodejs chat server, linked with a c# client, and I cannot do much about rooms and relate...

 
6:55 PM
0
Q: MySQL with Node.JS doesn't work

user3207681I'm working on a Node.js server with socket.io and wanted to integrate some mysql connection. I installed the mysql module a bunch of times and it still doesn't work. I don't know why. Here is my code: var express = require('express'), app = express(), server = require('http').createSer...

 
7:06 PM
0
Q: Node.js based clusters?

alianI need to create a service to run/manage rsync based backups between two remote machines? Is node.js cluster a good choice for this? I choose the HTTP protocol as the service based since it is so popular, but perhaps there are some frameworks out there that are more targeted towards this particul...

 
7:23 PM
0
Q: remove listener defined in function thats out of scope

Brad.SmithI have a module that has to recording functions I want to add. My problem is that because this.audio.stdout has a listener set for another function, I can only remove the listener activated when the start function is called without screwing up other processes. Because the value of filename change...

0
Q: sending data node app from serial port

gurpinarsI'm trying to connect arduino and nodejs app.I have an python script that is reading data from serial port. import socket import serial if __name__ == "__main__": while True: client = socket.socket(socket.AF_INET, socket.SOCK_STREAM) client.connect(('127.0.0.1', 8080)) ...

0
Q: Socket.io v1.0.X unknown transport "polling"

user987055Y have a problem in connection versión 1.0 that I dont had in the versión 0.9.X. I have Django running in http://app.myhost.com and my node server in http://live.myhost.com:8001 Before I could connect me to the node server like: Client: io.connect(//app.myhost.com); server: io.set('transpo...

0
Q: structure node.js App with modules

NicoI want to structure my Node.js app with modules. For example I use bunyan as a logger. I have a file main.js //configs var logfile = __dirname + '/log.txt'; //my own modules var log = require("./modules/log"), init = require("./modules/init"); So I´m passing the log file + path to the lo...

 
7:45 PM
0
Q: Cannot install TopoJSON in Ubuntu Linux

zahorakWhen installing topojson (sudo npm install -g topojson) I get the following errors: /bin/sh: 1: node: not found gyp: Call to 'node -e "require('nan')"' returned exit status 127. while trying to load binding.gyp gyp ERR! configure error gyp ERR! stack Error: `gyp` failed with exit code: 1 gyp ER...

 
8:25 PM
0
Q: not matching password parameter in sails controller

Jack Frosti am newbie in sails and i was making a simple login functionality in which the controller named find is going to db and checking if the user name password is valid or not, but the problem i am facing is it's checking for the user name and i think not for the password because in the param i am pa...

0
Q: How to insert blob into oraclu using node-oracle?

nottuI'm reading a file from my computer using var bytes = fs.readFileSync((fileName)); and try to insert it into an oracle db the node-oracle var oracle = require('oracle') var connString ="(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SID=orcl)))"...

0
Q: bookshelfJS: idAttribute to specify alternate id name

Dan PouliotI've added the idAttribute line to this code in hopes that it will allow me to specify an alternate name for my id field: bookshelf.ApiUser = Bookshelf.Model.extend({ tableName: 'users' , idAttribute: 'userID' }); but it breaks my node project. As long as my id field is named 'id', the...

0
Q: Evaluate custom javascript method (CircularJSON) with Jade

laggingreflexI want to parse an object into client-side javascript through Jade. Normally this would work: script var object = JSON.parse(#{JSON.stringify(object)}); but my object is circular and I need to do this script var object = CircularJSON.parse(#{CircularJSON.stringify(object)}); but it throws t...

-2
Q: $routeScope value got undefined when page is refresh in angularjs and nodejs

user3692716i am assigning a value to $routeScope variable in a controller on other page means other controller i got it right but if i refresh the page or press f5 key its value become undefined any help thank in advance

0
Q: Node.js Error, ECONNREFUSED when trying to post to Limesurvey RC API

Stephen StuckyI'm getting an ECONNREFUSED error (shown below) when trying to make a POST request with the request module to my server's limesurvey remotecontrol API. Is there something I'm doing wrong? Code is below error. Error: { [Error: connect ECONNREFUSED] code: 'ECONNREFUSED', errno: 'ECONNREFUSE...

 
8:42 PM
0
Q: Openshift nodejs application takes forever to build

Larry EliemenyeAnyone know why this happens. Even after taking forever, build always fails resulting in this error. An error occurred executing 'gear postreceive' (exit code: 1) Error message: CLIENT_ERROR: Failed to execute: 'control build' for /var/lib/openshift/5388e99b5973cabeab00028f/nodejs

 
8:53 PM
0
Q: digital envelope routines:EVP_DecryptFinal_ex:wrong final block length with node crypto

ewizardI am trying to decrypt a password so that I can check it against a password that a user enters on my website. I get this error when it tries to decrypt: TypeError: error:0606506D:digital envelope routines:EVP_DecryptFinal_ex:wrong final block length at Decipheriv.Cipher.final (crypto.js:292:...

0
Q: Nodejs and Jade rendered my submit button as a text field

Laurent BERNABEIn a nodejs application, with Jade templating, I can't manage to render a submit button. This is my app.js code : var express = require('express'); var app = express(); app.get('/todo', function(req,res){ res.set({ "Content-Type" : "text/html", "charset" : "utf-8" }); res.render(...

0
Q: C++ Addon example unable to find the greated module

user2512053Hey all I am trying to do the addon example located here http://nodejs.org/api/addons.html (Hello World). Everything seems to run fine until the final step. I recieve the error in the picuture I attached. [For this shot I even put everything hello.js and hello.node in same folder with no sucess)....

0
Q: Nodemon and node-ispector together

Uchiha ItachiI am working with node.js on windows. Normally i run my scripts like this with nodemon: C:\node\myapp>nodemon index.js I want to run it with node-inspector. How can i do it?

 
9:15 PM
0
Q: How can I send emails using my own mail server in Meteor?

LoupaxI am trying to enable email support for my meteor application, and since I have my own server I want to also use my own mail server. So I installed postfix in my Debian wheezy server and succesfully sent and email to my gmail address, so that means the mail server works properly and sends emails ...

0
Q: Game server, should I store model in memory or in mongodb

user3021198I have to write game server of online game, but singleplayer. Just map stored in mongodb. My question is which option is technically and logically better? Should i create global variable with sessions, that has children objects like map, buildings + methods. Create object on user login, load d...

0
Q: AngularJS RouteProvider and ExpressJS sendfile

user2669464In my Angular app, I'm trying to render partials that load into the index page when a user clicks a link. It worked fine before with the following code: //app.js in Angular angular.module('myApp', [ 'ngSanitize', 'ngRoute', ... ]). config(['$routeProvider', '$locationProvider', '$sceDelega...

 
9:49 PM
0
Q: Code organization (node, js involving models, service, route and mocha tests)

user3692927I'm quite a beginner in the project architecturing / structuring side of things. The overall project currently looks like: route/home.js service/appService.js models/appModel.js In the route file, I require appService.js. appService.js takes care of some API calls to external services, such ...

 
10:09 PM
0
Q: 404 when attempting rooting with param on Express

FrozenFlamei get 404 error when rooting with param , whereas all other rootings defined on my rootes/users.js file work perfectly , for example i get the desire result when i call : localhost:3000/users/users . but get 404 when i call localhost:3000/users/users/12315454 which should correspond to the rooter...

 
10:23 PM
0
Q: Splitting big main file in modules: can modules functions access main.js variables and modify them?

Lucas T.I have a file named server.js with 1267 lines of code right now, and I want to modularize that file to make it better, but I don't know if that will be possible, since I didn't have the intention to modularize the file in the begin(I didn't think the file would get that big). I have a bunch of fu...

0
Q: How can I speed up this sequence of promises?

rezaI have the following HTTP request handled in my node server. I have to send a list of disks back as a response. The code is: DiskPromise.getDiskCount(client).then(function (diskCount) { DiskPromise.getDisks(client, diskCount).then(function (disks) { RaidPromise.getRaidCount(client)...

 
10:55 PM
0
Q: Using Express 4 how to 'forward' to a route? Each route has it's own express.Router()

Daniel MI have my application structured with 3 Routes (api, admin, default). Each lives in there own file and has it's own middleware and exports a Route. The problem I am facing is when I want to forward to another route that lives on a different router. Essentially I want to call the same function so ...

0
Q: Websocket server cannot close connection with a client when nginx is used as proxy

benzhangNginx is sitting between websocket clients and a websocket server. When the server issues websocket close for a particular client, nginx does not relay that message to the client. And client will keep the connection open while I want the connection to close immediately. What is likely wrong? Is t...

0
Q: require('os').cpus().length returns 24 .... can't understand how?

user3385957I have a windows desktop with this configuration: Intel Xeon(R) CPU E5645 @2.40GHz (2 processors) with 24 GB RAM and 64-bit OS When I run following code. var cpuCount = require('os').cpus().length; It returns cpuCount as 24 Can someone please explain what exactly does this mean? And how ...

 
11:13 PM
0
Q: mongodb aggregation get the total number of matched document

ededI have a following sample docs saved in mongogb, like: { name: 'andy', age: 19, description: 'aaa aaa aaa' } { name: 'andy', age: 17, description: 'bbb bbb bbb' } { name: 'leo', age: 10, description: 'aaa aaa aaa' } { name: 'andy', age: 17, descrip...

 

« first day (13 days earlier)      last day (64 days later) »