« first day (55 days earlier)      last day (22 days later) » 

12:00 AM
0
Q: Nodejs Passport authenticate callback not being called with no errors

user3757063I've seen similar questions to mine, but I cannot find the right answer. I'm trying to implement a very simple login form using nodejs+express+passport (local strategy). The thing is, it seems that my authenticate callback always fails. I've removed every connection to the test DB (every tutori...

0
Q: Is sales.js seo friendly?

user3311522sales.js is the realtime mvc framework for node.js. Is it SEO friendly? in other words does it generate content on server and spit it out or does it use a set of values to attach to elements after the html is rendered.

 
12:20 AM
0
Q: Is there a Polymer component that simplifies communications with MongoDB?

Andrew PriceGiven the promise Polymer and web components have in simplifying development I am wondering if anyone has developed a wrapper component that simplifies talking to a MongoDB backend? Does anyone know of one? Is this a sane idea? I guess it would need a custom server-side piece, but even so, I exp...

 
12:31 AM
0
Q: Express Passport unable to get facebook friends list

ElementaryWhen attempting to use the Facebook api to get the friends list of a verified account it seems to work except that the friends list returned is empty. facebook.js var https = require('https'); exports.getFbData = function(accessToken, apiPath, callback) { var options = { host: 'gra...

 
12:49 AM
0
Q: How can I handle Mobile (cell) numbers from Various countries?

user3827534I am developing a mobile app which uses mobile number as login. The unique ID linked with each account created through the app will be its Phone numbers. the app also fetch contacts from the mobile device which is used to match with existing accounts available in our web service backend. The is...

0
Q: NPM Sinon requires buster-xxx?

nicholasI'm using mochify for unit testing, and would like to add some spies/mocks/stub capabilities. The package to use, it seems, is sinon, but my experience has been: 1) Install sinon as described in the docs and a dozen or more tutorials: npm install sinon --save-dev 2) Add a spy to my tests: va...

0
Q: memory state during execution of a server in node js

user2423039i am a newbie to designing a server in node js i know that node js runs in a single process, my doubts are 1)Is the memory state of local variables of a function stored even after its execution - Ex:function may start some asynchronous method whose callback is using those variables even after...

 
1:11 AM
0
Q: Routing Error with Not Defined Model Property

cphillI am running into a routing issue with Express 4, which is related to the properties I created for my mongoose schema. For some reason when I try a POST request, I am given a reference error that description is not defined. Did I mess up with my route request? Error: ReferenceError: description...

0
Q: how to imitate upload image with request in nodejs

MarsOnlyi want to imitate upload image with module request, and i get the request rayload through chrome network like this: ------------Ef1cH2gL6GI3ae0ei4Ef1cH2gL6GI3 Content-Disposition: form-data; name="Filename" 2033103.jpg ------------Ef1cH2gL6GI3ae0ei4Ef1cH2gL6GI3 Content-Disposition: form-data; n...

 
1:37 AM
0
Q: Node.js, Mongoose, Express - Validate user input for longitude and latitude

BenIm looking for advice on how best to validate a long/lat value that is saved to Mongodb via an Express API route. I have seen examples where a min and a max value can be defined in the model but I cannot get this to work. Here is my current model - see "geo": var placeSchema = mongoose.Schema({...

 
 
1 hour later…
2:38 AM
0
Q: Mongoose.js and the query object with Regexp

Crispen SmithIn a locomotive app, in a search engine that queries my models (with rather specific metadata that I won't go into here for the usual reasons) I need to include a regexp engine to check against the keywords field. My approach is as follows: this.keywords = strings.makeSafe(this.param("keyword...

 
2:50 AM
0
Q: Lazy Loading/More Data Scroll in Mongoose/Nodejs

Dave LeeI was wondering how to implement lazy loading/more data on scroll with mongoose. I want to load 10 posts at a time, but I'm not sure how to best load the next 10 elements in a query. I currently have: var q = Post.find().sort("rating").limit(10); To load the 10 posts with the highest "rating...

 
3:27 AM
0
Q: Why does express -sessions not work for me?

mikeLspohnI am working through Manning's new Getting MEAN book, and wondering if this example is already deprecated or if I am doing something wrong.

 
3:45 AM
0
Q: Run Grunt Exec Command in order

owenleromodule.exports = function(grunt) { grunt.loadNpmTasks('grunt-exec'); grunt.initConfig({ exec: { loop: { cmd: function() { for (var i = 0; i <= 1000; i++) { var list = externalfunction(i); list.forEach(function(j) { consol...

0
Q: Why does V8 / Node de-optimize this function?

BartvdsI'm checking some high-performance Node.js code for V8 optimisation and I am mystified why this function never gets optimised: (value is a Buffer, push is a closure that offloads the value) function bufferWrite(value, push) { var buffer = new Buffer(1 + 4); buffer.writeUInt8(BUFFER, 0); ...

 
4:03 AM
0
Q: Q promises nfcall wrapping result in unnecessary array?

gladsoccI've been experimenting with promises with Q, and it seems that the nfcall promise response is being wrapped in an unnecessary array. The mysql model normally returns the result in an array of rows. Example: db.query('SELECT * FROM table', function(err, rows){ console.log(rows[0].id); c...

 
4:17 AM
0
Q: [nodejs-webkit]how to switch script context from global namespace to global.window namespace in addon

user3827881I am try to execute lots of js code(with lot of jquery code) in addon with following code: Handle script = Script::Compile(source, name); Handle result = script->Run(); but I find that the js execution space is in global, not the same as the execution space(global.window) in html. Is there any...

0
Q: how to set request headers for node.js using request module

user3821715how to set request header for request module to carry the log in data (username, password). then extract data from the response and set the login info in the other request's header to scrap that page that required user to b logged in with node.js request module

 
4:47 AM
0
Q: Obtaining html source code using XMLHttpRequest.js for parse.com's Cloud Code

MahirFor Cloud Code (parse.com), I'm trying to scrape web data from another website, but I have been unable to get the source code of the websites as a string. I tried using the xmlhttprequest module var url = "www.targetWebsite.com"; var XMLHttpRequest = require("cloud/XMLHttpRequest.js"...

 
5:04 AM
0
Q: Is there any way to create a node.js application that will remap OSX keypresses?

ViclibI want to write a Node.js application that will remap OSX keys. It will interpret keypresses from OSX, and send back the correct key, which will be received by the application. It should intercept every keypress in any kind of software. Is that possible?

 
5:25 AM
0
Q: Web app client and REST API in same project?

tejas-manoharhttp://scotch.io/series/getting-mean --> was following these guides (started on setting up MEAN app before API one...!?!?!) So I'm writing a MEAN stack application and realized a mobile app would be really necessary for this to succeed in the future. With this in mind, I think I should write a R...

 
5:37 AM
0
Q: nodejs http post request throws TypeError

MikeNQI am trying to make a simple server that use google oauth (without express and passportjs, as I want to study the data exchanged). When my program attempts to send a post request to google, nodejs throws: http.js:593 throw new TypeError('first argument must be a string or Buffer'); I have che...

0
Q: Twitter streaming issu using Nodjs "Twit"

SreejithI Just try to streaming tweets form twitter using nodejs with "Twit" (npm) my code is look as follows. stream = tweeter.stream('statuses/filter', { track: phrase, language: 'en' }); var testTweetCount = 0; stream.on('tweet', function (data) { var currentdate = new Date(); var d...

 
6:03 AM
1
Q: Is it rational/practical to run and test AngularJS web applications without NodeJS?

MarkI have read that AngularJS for many, is the way to go if you want to build single-page web applications but I don't want to depend on NodeJS because my production server is shared-hosting and they don't allow processes to be run on the server. My company have no plans on moving away from shared-h...

 
6:27 AM
0
Q: NPM Dependency upgrade management

user3828164I wanted to keep two version of package.json 1. Package.json that has the exact version number This version I will use for my upcoming release, primarily to avoid any breaking change in the external code. 2) The second version of package.json I wanted to use the latest versions of all dependencie...

0
Q: Alternative for .click in cheerio

user3513697Hello i am using cheerio in node.js and its not supporting .click() method although cheerio supports to some extent jquery but .click is not working it is showing no .click method so is there any alternative method in cheerio to .click() ??

0
Q: Pass js object with ajax request

Cereal KillerI need to send a js object to the server through ajax request; is an object containing parameters for a sql query with Sequelize orm in node js; an example is like this: var data = { include: [ { model: model.Shop }, { model: model.Product, include: [ ...

0
Q: Sails.js best practice in using transactions with promises (Postgres)

ZukerI'm using sails 0.9.16 with Postgres and my question is: what is the best way to execute transaction using current API with promises? May be there is something better than: Model.query('BEGIN TRANSACTION', function (err) { if (err) { next(err); } else { Model ...

 
6:46 AM
0
Q: get the response of a web page using nodejs

Sushusing node js from the following code how can i get the response of the page. in below code how can i get the reponse of test.html var http = require('http'), fs = require('fs'); fs.readFile('./test.html', function (err, html) { if (err) { throw err; } http.crea...

 
6:57 AM
0
Q: Structuring modules, models in Nodejs with promises

spirytusI'm creating basic NodeJS/Express?MongoDb app. I have api module (controller) that basically checks the path and tells models to do things: api.js var users = require("../models/user"); module.exports = function(app, u) { app.get('/api/v1/users/get-all', function(req, res, next) { ...

0
Q: Memory consumption of node.js process increases constantly

RaphaelI made a simple web server using express: var express = require('express'); var app = express(); var route = express.Router(); route.get('/foo', function(req, res) { console.log(req.url); res.json(200, {'status':'OK'}); }); app.use('/api', route); app.use(express.static(__dir...

0
Q: How do I get karma webdriver launcher to use my selenium server/grid

EvolkCan anyone help shed some light on to what is stopping Karma javascript test runner from connecting to and using my selenium grid/server? I have a successfully working selenium grid environment that I already use with python selenium bindings for web application system testing. I'm running Selen...

0
Q: how to convert utf-8 to simple html node.js

user3163213I am reading an HTML file with filereader in node.js fs.readFile('public/template.html', { encoding: 'utf-8' }, function (err, data) { if (err) { return console.log(err); } res.render('website', { body: data }); }); It renders utf-8 encoded string , But I want to use it as ...

 
7:39 AM
0
Q: Ember-CLI setup to use RESTAdapter properly

Lorant Alexandru KurazsI'm new to ember, yet I want to learn to use EMBER-CLI MVC properly. All is fine, besides one thing, I'm not sure how and where to configure the API which feeds the JSON to my Ember-CLI app. Here is my API details: API Server is hosted on: > http://mydomain.com:8080/summary/OTRS/v1/ After '/v...

0
Q: NodeJS Connect error - has no method 'logger'

CarlhakoFairly new to nodejs here. I have a nodejs webserver running that serves up data via ajax. I now need to extend the server to respond to various post requests. All I am trying to get running is the bodyParser middleware but on a different development pc. os: debian nodejs: v0.10.29 have run "np...

 
8:12 AM
0
Q: Node.js / Express - Strange behaviour: random 200 instead of 404

afzaalaceI have Nodejs v0.10 installed, and running latest Expressjs. The code is just a scaffold generated using express-generator. While I refresh a non-existing URL '/g' (by continuously pressing the F5 key), I get the following log in the console. GET /g 200 0ms GET /g 404 1ms - 1.04kb GET /g 404 1m...

0
Q: NodeJS serve media file (video and audio)

Sebastian ZabelI have a problem with NodeJs serving media files. The fileserving works in firefox but Chrome and IE have some trouble. Chrome can only play the file once and controls are not working. IE plays the file multiple times but controls are not working. For both of them I had to implement a workarro...

0
Q: Error on npm install

VictorienI'm trying to install npm on my virtual machine but when I do "npm install", I got this log : npm WARN package.json blog.wizzvet.com@0.1.0 No description npm WARN package.json blog.wizzvet.com@0.1.0 No repository field. npm http GET https://registry.npmjs.org/grunt-contrib-clean npm http GET htt...

0
Q: Atomic Find and Insert in MongoDB

dCoderI am using mongoose for an inventory management web application. I designed schema such that my last record will contain the current stock of an item. I need a way to perform an operation like this : 1. db.inventory.find(lastrecord); 2. db.inventory.insert(currentrecord.stock = lastrecord.stoc...

 
8:41 AM
0
Q: How to find a sub-document using Mongoose?

LVarayutI'm trying to get a sub-document in my User collection using mongoose. I followed the Mongoose Sub Document on its official website. It's written that: Each document has an _id. DocumentArrays have a special id method for looking up a document by its _id. var doc = parent.children.id(id); Her...

 
8:57 AM
0
Q: Why do I get undefined when trying to parse POST request with busboy? Using MEAN.IO stack

CYenI am trying to use busboy-connect to parse my request file that I send to the server. When I print out my request object, I get this huge Angular.identity object and when I try and parse the object using this code: app.post("/compositions/fileUpload", function(req, res){ var fstream; req....

0
Q: Node.js https request of a web page

user2685083var https = require('https'); var http = require('http'); var requestInput = (process.argv[2] === 'https' ? https : http); var options = { hostname : 'encrypted.google.com', port : 443, path : '/', method : 'GET' }; requestInput.get(options, function (res) { console.log("statu...

 
9:11 AM
0
Q: forever fails startup when using -l param

kenI'm using forever to keep the Ghost blogging platform and few other services running independent of a console session. I run this command from within a nodejs script using the 'child_process' module like so: var shell = require('child_process').spawn; var params = [ 'NODE_ENV=production', ...

0
Q: Callback not provided pattern in NodeJS

sgmondaI usually write NodeJS code for hours, and there is a common situation I'm not sure how to face. Given the following async function call (where we forget the needed callback): function foo (callback) { // Perform a task and call callback when finished callback(); } foo(); // We forget th...

0
Q: Using Async and Promises that are all rejected leads to async never completing

Dave SagI'm using async and promise to run a seeding script but in the case where all promses are rejected the script never completes. As it's a seeding script it's set up to not seed models that alredy have data. Here's (abridged) my code Any idea what I've missed? seed = function(collectionName, da...

 
9:38 AM
0
Q: Error Executing Hello World from Kraken-JS

user1095279Am following the instructions from the website, http://krakenjs.com/#getting_started. I am running it in Windows 7, 64 bit. I first ran the command, sudo npm install -g generator-kraken After this, yo kraken and I created the HelloWorld module. But I could not see the full structure inside...

 
9:59 AM
0
Q: how can i mount mvc nodejs + express

user3799004I have a nodejs + express project. I want to mount controller and view, but i dont know how. In my app.js has var stats = require('./controllers/stats'); and app.use(stats); My folder controllers: stats/index.js and my views: stats/index.jade. when I try to access localhost:1200/stats --> Cannot...

-1
Q: Copying data from one array to another

user87267867I have two arrays as given below. var obj1 = [ { "POST": "Developer", "USERNAME": [ "User1", "User2" ] }, { "POST": "Tester", "USERNAME": [ "User3" ] ...

0
Q: Can we keep node.js socket connection active on page refresh?

jpkIs there can put any delay for disconnect in server side and reconnect again with the same socket id after the page refresh ?

 
10:25 AM
0
Q: ldapjs authentication error when binding to LDAP server

J33nnI have issue on connecting to LDAP server using ldapjs lib. For some reason I cannot bind to ldap server using my credentials: var ldap = require('ldapjs'); function authDN(dn, password, cb) { var client = ldap.createClient({url: 'ldaps://myserver:1234'}); client.bind(dn, password, fun...

 
10:42 AM
0
Q: Is it possible to to send bulk pre-rendered email via the SendGrid API?

TobiI checked teh SendGrid API docs, and didn't find a possibility to send bulk pre-rendered emails. Is this possible? What I want to do is use my own templating engine to render the individual email content, and then upload these (including recipient, subject and the mail body) as bulk to the SendG...

0
Q: same response different routes in express.js using regex

VishalI need to create two URLs that sends same response. app.get('/:city', sendCityResponse); app.get('/:city/filters', sendCityResponse); How can i make it as one route using regex? I tried this: app.get('/:city/:type(filters|^$)') but with no success.

 
10:58 AM
0
Q: Querying date in ISO format issue

AnupI have date of birth field in my collection which saves data in ISO format like this :- ISODate("1980-01-01T20:20:19.198Z") In my html page the date time picker it gives me date in model like this :- 01/01/1980 When i query for date of birth it gives me nothing so i tried :- dateofbirth = ...

0
Q: req.files is empty when trying to upload a file to server with node js

user3545212HTML: <form action="/uploadpic" method="post" enctype="multipart/form-data"> <input type="file" data-clear-btn="true" name="image" id="new_pic" value="" placeholder="Choose File"> <input type="submit" value="Add" style="width:30%"> </form> NodeJS: app.post('/uploadpic', function(req,r...

0
Q: Fatal error C1083 installing ursa

user336- i actually chose thisI got the following error installing URSA on node.js (I'm using windows 7). I have tried (reading on the internet it seems the problem has to do with SDK or OpenSSL): Reinstalling Windows SDK 7 Upgraded to the newer version 7.1. Reinstalled OpenSSl 1.0.1h 64. Removed the previous and installed O...

 
11:27 AM
0
Q: EasyRTC Download Conversation

Can Şahin BakırIm developing video chat/conferance application on node.js.I want to download conversation after video chat/conferance.How can I download EasyRTC Video Chat/Conferance conversation.Is it possible? Thanks.

 
11:39 AM
0
Q: get last 30 records from mangoDB

wazzadayIs it possible to select the last 30 or any amount of records inserted into a mangoDB currently using find with all parameters emitted. db.tweets.find({}, function(err, docs){ response.end(JSON.stringify(docs)); }); Im not sure what needs to go in the curly brackets.

-2
Q: What is the difference between . and .. in require with node.js?

Samantha JIn some code I am learning about I see: var modal = require('../../Functions/modal_func.js'); var page = require('./page.js'); Can someone tell me the difference between a single "." and a double "." in the require?

 
12:21 PM
0
Q: Custom Handlebars Helper with partial as a parameter

dgsunesenI'm trying to create a custom handlebars helper, and I want to be able to pass it a "base-template" and a "partial".. So what it should do is render the base template and then render whatever partials is passed as the second parameter. I have the following right now: module.exports.register = ...

0
Q: Writing json data to text file in nodejs

saravanaI am creating a nodejs server which receives json data from client.At now i can display the json datas in console.but how can i write those datas to txt file?thanks in advance http.createServer(function(request, response) { console.log("Request received"); response.writeHeader(200, {"...

1
Q: Use child_process.exec's return value in if statements?

Jacob PedersenI have this function: function checkfType(a,b){ exec("file '"+a+"'",function(err,stdout,stderr){ if(stdout.containsString(b)===true){return true}else{return false} }) } However, if I use it in an if statement like this: if(checkfType(".","directory"){}, it just goes "false". I tested t...

0
Q: Cant install npm msgpack on my amazon ubuntu server

user2765977I'm afraid i'm a but new to unix environments in general, but I am trying to install the msgpack package for my amazon ec2 ubuntu nodejs setup using the following command: sudo npm install msgpack2 However it fails with the output listed at the bottom. Pls note things I have done so far includi...

0
Q: Why does Yeoman uses Bower?

gpeI am starting to use these tools and am still in the process of understanding their meta-dependencies. As I see Yeoman, it is a client for npm with some "wizard" capabilities. It already install the dependencies of the generator used. Why, where and how is Bower used and needed here? Why does Ye...

 
12:51 PM
0
Q: Error Connecting to CouchBase from Node.js using Couchnode module v.1.2.4

nelsonicUsing https://github.com/couchbase/couchnode @v.1.2.4 Attempting to connect to CouchBase server using the code in the README var couchbase = require('couchbase'); var cluster = new couchbase.Cluster(); var db = cluster.openBucket('default'); db.set('testdoc', {name:'Frank'}, function(err, res...

0
Q: node-red mqtt installation error

AlvinsI'm trying to install node-red on ubuntu 14.04 lts. I've installed nodejs and nvm, then i've launched: git clone https://github.com/node-red/node-red.git cd node-red sudo npm install --production I got this error: .... npm http GET https://registry.npmjs.org/uglify-js/2.4.13 npm ERR! Error: ...

0
Q: Error when trying to run a simple program in node js

user3239296Am new to node js when i try to execute the below program am getting an exception as var mysql = require('mysql'); var connection = mysql.createConnection( { host : 'localhost', user : 'root', password : 'Gemini*123', database : 'test' } ); connection.con...

 
1:13 PM
0
Q: RESTful connection mean stack

byrdrCould someone explain the RESTful API connection. I'm having trouble wrapping my head around the exact sequence of events that happen from the function being called in Angular to the JSON being manipulated in the mongodb. I have the create part of the CRUD working, an explanation of the sequence ...

0
Q: Node Streams, wrap array as object

amenadielI have a metadata object in the form { filename: "hugearray.json", author: "amenadiel", date: "2014-07-11", introduction: "A huge ass array I want to send to the browser" } That hugearray.json is a text file in my folder which contains, as its name implies, an array of potenti...

 
1:32 PM
0
Q: How to create a thumbnail that fills a certain area in meteor with CollectionFS and graphicsmagick

Jared MartinRight now I'm using the code here: https://github.com/CollectionFS/Meteor-CollectionFS#basic-example Suppose I want a thumbnail 100x100. But say my image is 400x200, the code above will produce a thumbnail 100x50. What I want to happen in this example is for the image to be resized to 200x100, ...

0
Q: Don't let deployments cancel file uploads

Sebastian HoitzWe have an application that accepts file uploads from the user. Whenever we deploy our application we stop the application process and start it again. All lengthy processing is done before we actually stop the application so the actual downtime is fairly small (a few seconds). However, when sto...

0
Q: node js and jquery(ajax); post is fired without click event

NewbieI use jquery(ajax) in my form to post to server.js to do some action according to which button was clicked. The code is executed fine when i click my button. However if i leave my server.js open, every few minutes it executes again and again without clicking the button ! I thought the problem wa...

0
Q: supertest nodejs test get call

Fez VrastaI'm building an API and I'm trying to test it with mocha and supertest. I'm correctly testing a POST call with this code: it("Should generate a PDF based on the given data using API", function(done) { request(app) .post("/api/document/print") .send({tplName: "default", tplData: { t...

0
Q: Prevent expressjs from sending text in bare response

Thinking SitesI am using expressjs to implement api calls for my app. Much of the time I don't want to send back extra data in the body however expressjs sends the http status text in the response if you don't specify a body. For res.send(200); outputs OK in the body, res.send(400); outputs Not Found and so ...

0
Q: Object has array as property and is maintaining values between users and requests

Anthony VeachIn app.js I implement this middleware: app.use('/api*',preRouter.prepareData); This is the beginning of the prepareData method: function(req,res,next){ res.SerenityOut = { status : 1, errors : [], messages : [], type : null, organization : null, ...

0
Q: Node maintain variables in memory

William FalconIs Node stateful? If I want to build an index to keep in memory, will it persist throughout different connections? I'm just wondering if this is possible. For example we have a server in java that maintains a hashmap in memory to speed up certain search queries. It modifies it as things co...

 
2:18 PM
0
Q: http cache and fingerprinting usage

facebookI am trying to understand how http cache and fingerprinting works. I've setup my express server to cache assets forever like this: router.use('/public', express.static(path.join(__dirname, '..', 'public'), { maxAge: 864000000 })); I am expecting this to cache assets forever,...

 
2:29 PM
0
Q: Node.js: http request timing out after 1 minute

incutonezI am using Node.js (version 0.10.28) to make an http.request to my Ruby API for a large amount of data (21,000 rows from a PostgreSQL database). The problem is that the request seems to time out after 1 minute and return a 404 error, and I know this is true as the Ruby API returns just over 60 s...

0
Q: NodeJS converting image stream to base64 gives invalid data

T NguyenI'm trying to generate a QR code and then return it as a Base64-encoded data URL. I know that there's a module (https://github.com/cmanzana/qrcode-npm) which is supposed to be able to do this directly, but I'm having trouble installing the canvas module dependency. I'm still working on that fro...

 
2:51 PM
0
Q: Trying to make a webpage with node.js to insert input to database

SlicedbreadI'm trying to write a webpage with some input fields that when you hit submit the input in the fields is sent to an azure table store. I have the input fields set up and I was able to insert hardcoded values to the database, but I'm having trouble tying them together. I'm using node.js with exp...

0
Q: How to streaming video in nodejs

paynestrikeI'm really new to video streaming, It confuse me front end:Video.js <video id="example_video_1" controls="" preload="auto" width="854" height="480" poster="/thumb/1405003437328.mp4-thumbnail-1-undefinedxundefined.jpg" data-setup="{&quot;example_option&quot;:true}" class="video-js vjs-default-skin"

 
3:22 PM
0
Q: Writting custom functionality of google cloud messaging service

ManMohan VyasWhat I need is to create a android game app where user interact with each other. And user can chat as well. I was in the initial R & D face, I was looking into the ways I can implement push to the android device. What I found was over net is the following two poular ways: 1) using nodejs. 2) u...

0
Q: How to run a Node.js like a cron job?

user3398326I had a php file which made a REST API call to a url which returned a json object. I converted the code to Node.js as show below which works like a charm. However, i ran a cron job for my php script to run every 5 minute. I am not sure how a node js would work in this case ? Can i make node j...

 
3:47 PM
0
Q: Allow cross domain ajax calls Node.js and Express 4

Ryan WaltersI am currently making an AJAX call in AngularJS to load JSON formatted data from an external web server. I am running Node.js with Express 4. When attempting to load the data from an external web server, I receive the error: XMLHttpRequest cannot load [URL I'm loading]. Origin http://localhost:8...

0
Q: Getting data from server from mongodb

Chauncey PhilpotOk, so I'm trying to get data from mongo to the controller. I've been at this for a couple days now. Here is my repo https://github.com/chanpod/WhoCanMakeIt If you do clone the repo and run the app you'll obviously need npm and a mongo server running. Once you do that, just npm install, npm st...

 
4:07 PM
0
Q: Mean Stack delete callback

byrdrI have my Mean stack delete functioning properly; however, I can't seem to figure out how to update the view with the updated JSON once deleted. My express server side logic: .delete(function(req, res) { Service.remove({ _id: req.params._id }, function(err, service) { if...

0
Q: Unziping zip file in NodeJs - getting only one file

user2902985I am writing small script to unzip some ziped files. I have to connect to ftp, read zips, get xmls from zips and save them to mongodb; And I have problem with very first file i downloaded from ftp. I do: var fs = require('fs'), unzip = require('unzip'), fstream = require('fstream'); fs.cre...

 
4:49 PM
0
Q: How to share Cloudant database connection using nano in node.js application

luthienI am looking for guidance on how to connect to a Cloudant database once, using nano from a node.js application, such that the connection can be reused. Right now what I am doing seems inneficient. In app.js I require a cloudant routes file: var cloudant = require('./routes/cloudant'); And I ...

0
Q: Session error on heroku with Node and Mongo

BenHI'm getting the following error when deploying my app to heroku. I don't have any errors on localhost. What am I missing here? GET / 304 522ms GET /public/stylesheets/bootstrap.css 200 15ms - 131.2kb GET /public/stylesheets/style.css 200 3ms - 799b GET /public/images/food2.jpg 200 62ms -...

 
5:06 PM
0
Q: Trouble using $group twice in mongodb aggregation query

isaac9ALet me start off by saying I am new to mongo and node.js. For each client I work with, I am looking at the past week of traffic to find the max and min of six variables and their dates. Right now mongo aggregation takes care of some of the work but I am convinced that it can do more. Right now my...

0
Q: How do I display a succes message after this forEach loop?

SamIn this script I'm checking a list of css files for syntax errors: 'use strict'; var fs = require('fs'); var chalk = require('chalk'); var rework = require('rework'); var expand = require ('glob-expand'); var conformance = require('rework-suit-conformance'); var files = expand({ filter: 'isF...

0
Q: Use of colors module in phantomjs

askI need to use colors (or similar npm module, suggestions are welcome) with phantomjs. This is the code that I have: var page = require('webpage').create(); var url = require('system').args[1]; var fs = require('fs'); var colors = require('colors'); console.log(">>In Phantomjs Process...".yell...

0
Q: bind C++ virtual methods to js with override capability

3p3rAssume I have a C++ class: class cRenderer { ... virtual void draw(); ... } This is part of a render engine, so any C++ class that inherits cRenderer can override the draw method and have stuff drawn on the screen. The question is how can I implement the same behavior with v8 bind...

 
5:33 PM
0
Q: Issue sending Http POST request to Nodejs Server

JerryFoxI am having an issue sending over an array of information from my client.js to the node server using an http POST request. After a couple of days I think I have narrowed it down. My current set up is the following: Server After X amount of time, the server will start to ask clients to send th...

 
5:51 PM
0
Q: How do I turn logging off for Elasticsearch in Node.js?

HousemanI'm using the elasticsearch npm module. I get annoying yellow warnings because my elasticsearch server is currently off. How can I make it so that it doesn't log anything?

0
Q: Having trouble getting passport.js working. Unable to get the user.

senjougaharaIn my mongodb, there is clearly a User with username "testuser", but I am still getting "failed to login!" when I enter this in. Note: Not using the password yet. Just trying to make sure I can check that the entered username exists first. navbar-login.jade .navbar-right(ng-controller="mvNavBar...

 
6:17 PM
0
Q: gulp-livereload error when run gulp task

user3632930running gulp-livereload + tiny-lr, in two projects, i have an error only at last project, when i use the same gulpfile.js, tried run only one per once, but not work, only my last project got the error: ... Uhoh. Got error listen EADDRINUSE ... Error: listen EADDRINUSE at errnoException (net....

 
6:29 PM
0
Q: Grunt process breaks at certain point generator-angular-fullstack

TinoCan someone please help me explain what that does. The grunt process produces errors. I need to find out why. What does the "src" do? imagemin: { dist: { files: [{ expand: true, cwd: '<%= yeoman.client %>/assets/images', src: '{,*/}*.{png,jpg,jpeg,gif}', dest: '<%= ...

0
Q: Override web api polyfills with browserify

Gareth AyeSuppose we're using browserify to make a js module available to code running in both the browser and nodejs. Then suppose we have a web api like https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest and a nodejs polyfill for it (eg https://github.com/driverdan/node-XMLHttpRequest). I w...

0
Q: Javascript prototype returning value is undefined even though it's correct in the prototype method

CatfishI'm trying to create a simple method to convert xml to json. I'm trying to do it using javascript's prototype because i'm trying to learn how to use prototype and because I want to be able to do something like myXmlString.toJson(); I have the script below which demonstrates that the xml string g...

 
7:08 PM
0
Q: gulp.js - How do I return multiple streams back to main stream?

Chris MontgomeryI want to start a gulp.src stream, pipe that to a function that creates a bunch of new streams and then pipe the result of those to gulp.dest. Below is what I have so far but it's obviously not working since I'm piping the streams back to gulp.dest which blows up because it's expecting a file, no...

0
Q: mongoclient remove collection nodejs

user3830592I am trying to remove the entire collection, but it is not working with the below nodejs code. The same works within mongodb using command [db.collection.remove()] There are no errors, but the below returns count of events as 0 smevents.count(function(err, count) { console.log("There are "...

 
7:26 PM
0
Q: Strange error while deleting a file using the module fs in node js

Usi UsiI'm trying to delete some files in a folder using the module fs. I need to delete a file only if it is older (modified time) that 1 minute. But I get a strange error. var fs = require("fs"); var files = fs.readdirSync("./folder"); for(var i in files) { fs.stat("./folder/"+files[i], function(...

0
Q: nodejs http.listen ( remote https )

ValRusI am trying to do next: Remote nodejs server (app.js): var http = require('http') http.createServer(function (req, res) { res.writeHead(200, {'Content-Type': 'text/plain'}); res.end('Hello World\n'); }).listen(80, "https://adress.com"); Remote nginx client (index.html): <script src=...

0
Q: NodeJS - Combining Mongo-Watch and Variety.js to return MongoDB document keys - ChildProcess Error

user3700442Like my title says, I'm trying to combine the Mongo-Watch module (https://github.com/TorchlightSoftware/mongo-watch) and the Variety module (https://github.com/variety/variety) so that I can have Variety return all the keys for a MongoDB collection when it's been modified. Because Variety is a co...

0
Q: node http.request ECONNREFUSED on ubuntu

jbhelfrichI've written a script to check if a large number of 301 redirects are properly configured. The script passes the original target and the expected redirection to the following function: function check301(source, destination){ console.log('Calling check301 for ' + source); var options = { ...

 
7:49 PM
0
Q: Variable query parameter for MongoDB + NodeJS + ExpressJS

zorianakWhat I'm trying to do is pass a parameter into a get() method (I am currently using Express as my middleware). Right now, I'm able to pick up which color is passed, and see if it's undefined or not. However, it seems like the query doesn't seem to work. The color is defined by an option that the...

-3
Q: Prerequisites for learning Node.js/RoR

user707223I have had some experience in Java development as well as android development. However I want to move to a new set of tech and somehow found node.js and Ruby on Rails to be exciting. I wanted to know are there any technologies/languages I must learn before jumping into either of them. I did som...

0
Q: Node.js ursa module encoding troubles

VanyaI have the problem using https://www.npmjs.org/package/node-rsa var crypto = require('crypto'); var ursa = require('ursa'); var colors = require('colors'); keys = ursa.generatePrivateKey(2048 , 17); try { var random = crypto.randomBytes(100); console.log('Have %d bytes of random data', ra...

 
8:32 PM
0
Q: angular-route error Arguments to path.json must be strings

GioPanI am having a hard time figuring out what this error means. I have the following bower.json: ... "dependencies":{ "angular-route":"~1.2.18", "angular":"~1.2.18" } Upon installing my bower packages through bower install I get the following error: bower angular-route#~1.2.20 error Arg...

0
Q: MongoDB doesn't return same output on two functions in different places

mikroskeemI'm trying to make blog-styled dynamic page with MongoDB and Node.JS. But problem is if I search whole collection with find() in route "/stream", it finds several posts. But if I try to do find() in route "/json" it doesn't find anything. Code is here: https://github.com/mikroskeem/funnix/blob/...

0
Q: How to make indexOf only match 'hi' as a match and not 'hirandomstuffhere'?

WoopWoop WoopWoopBasically I was playing around with an Steam bot for some time ago, and made it auto-reply when you said things in an array, I.E an 'hello-triggers' array, which would contain things like "hi", "hello" and such. I made so whenever it received an message, it would check for matches using indexOf()...

 
8:45 PM
0
Q: Can't access attributes of json object using nodejs

Alexandre FerreiraSo, I'm trying to read a json file and access the attributes that were written in the file. The file is: { 'name': 'SpectrumApp', 'version': '0.1.0a', 'description': 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam a lectus quis odio semper suscipit. Duis ac...

0
Q: Send response data in chunks

Mj1992I've a function sendResponse which is called with data multiple times. What I want to do is whenever this function is called with the result, I want to push the result to the client in order to cut waiting time for the user. Is it possible to accomplish in nodejs. I've tried using res.write but...

0
Q: Running two javascript functions in one button click in jade

user3826281I have my html set up and my javascript functions ready but I can't get it to run both at the same time only one runs once I click the button. I'm using the Jade template engine with Node.js and this is what I have so far: input(type = 'button' value = 'Calcular' onClick = "calculateComission()...

 
8:58 PM
0
Q: repeat asynchronous $http get until condition holds true

Zachary L'AngloisBackground: I am using node.js and a module called scrap (with jQuery) to screen scrape a website and display some of its information on my own website To do this, I am making a JSON of data available at a certain path in my website so that the client can retrieve the information when they load...

0
Q: Bower - error when installing package "Arguments to path.join must be strings"

AdamI just created a node project and am trying to install jquery using bower. bower install jquery I get the following error: bower jquery#* not-cached git://github.com/jquery/jquery.git#* bower jquery#* resolve git://github.com/jquery/jquery.git#* bower jquery#* ...

 
9:17 PM
0
Q: Gulp Connect not running server

dazerI created the gulpfile.js and in it has a use for gulp-connect gulp.task('connect', function(){ connect.server({ root: 'dev', livereload: true, port: 8000 }); }) When I run gulp connect it does not maintain my server on localhost:8000. [14:08:51] Starting 'con...

 
9:33 PM
-1
Q: How do I pass a command to a screen session?

SaraI'm writing a Linux shell script in which I need to start a new screen session, run a node.js server in the screen, then detach from the screen so that my server runs in the background. Right now, these are the commands I run manually to do this: screen node server.js [detach screen] However...

 
9:45 PM
0
Q: Backend-driven data refresh in mobile app - concurrency in booking

RaffaeleI'm writing an app with a booking functionality, in which the user can choose from a timetable which should be automatically updated reflecting other users' booking - in order to avoid double booking and concurrency. I'm currently using Sencha Touch and the backend is in PHP+MySQL: so for now my ...

 
9:56 PM
0
Q: setting timeout in node.js + express

HousemanI have this: var app = express() , https = require('https') , server = https.createServer(options,app) , io = require('socket.io').listen(server,{log:false}) , util = require('util'); app.set('port', process.env.PORT ||3000); app.set('views', __dirname + '/views'); app.set('vie...

0
Q: How to install SQL Server 2012 Express Unattended from Enterprise media?

user3831028It's pretty simple to install Express from the full Enterprise media interactively, but when I attempt to install it in quiet mode using the generated configuration INI file, the installer hits a brick wall. A digest of the error summary follows: Overall summary: Final result: ...

 
10:16 PM
0
Q: Arranging items from a mongoDB object into a list top to bottom with Angular.js

JustinI have a simple todo list app with node.js, angular.js, mongoDB and mongoose as the object modeling. I want to be able to have the newly added item be insert on the top of the list an not the bottom. I thought this was an Angular.js prepending issue, but upon further reading it is because the dat...

0
Q: Using Browserify with jQuery Plugins

Chetan ShenoySome brief background: I'm using browserify and browserify-shim (and gulp to build) to create a web app. Prior to today, I was just requireing jquery from npm so I had no issues. Once I started doing some optimization, I realized how massive the bundle was with jQuery included. So now I'm grabbin...

0
Q: mongodb findone return value - array manipulation

user3658423I am running node.js server (with express & jade) and mongodb database. I have a function where I query mongodb using findOne. The document is about a user along with an array element that has their preferences. So the schema looks like this... var userSchema = mongoose.Schema({ username ...

 
10:45 PM
0
Q: about asynchronous execution flow in Node.js

user3537531good, I come to ask what would be the best way to make the task of showing a Mysql data taken ¿Think this flow is correct? app.get('/demo/:id', function(req, res) { var query = csql.query('SELECT * FROM table_videos WHERE id=? LIMIT 1',req.params.id, function(error, result){ if(error){ ...

0
Q: How to promisfy MongoDB/Mongoose .findOne before .push, in an array.forEach?

StackThisHave looked through the bluebird readMe examples, and am still wondering how to implement/convert some async code to involve promises with .then.. There are a number of ifStatements in here, though the main point is that while looping through the toArray, if the element exists in the database (f...

 
11:29 PM
0
Q: Node C++ extension loading in docker only Segfault on Google Compute Engine

kou9I am experiencing an extremely weird behavior with docker containers + node on Google Compute Engine. The setup is the following: I have a docker image pushed to a private docker registry This image is created on top of ubuntu 12.04 (FROM ubuntu:12.04) The code i am running is javascript Node c...

 

« first day (55 days earlier)      last day (22 days later) »