« first day (12 days earlier)      last day (65 days later) » 

12:01 AM
0
Q: Printing formatted, rendered html content

crankshaftI have been searching google for examples or jquery plugins that allow you to print an html page exactly as it is rendered. I have a nodejs web application and I need to create some nicely formatted reports, I have created them and used dimensions for the css widths, heights etc so that it is co...

0
Q: Scoket.IO Token based auth -- can't pass token?

SamsquanchI am using this tutorial to get the basics of a token-based auth system in place. Here is the code I'm using: In app.html: var socket = io('', { // originally I thought the $.param might've been a problem, so I hard coded a token instead // query: $.param({token: 'i271az2Z0PMjhd6w0rX019g0iS...

0
Q: Using a ReST infrastructure with node-httpp

auroI'm new to node.js and new to node-httpp (note the double-p) which seems like a great framework for running http/https over UDT (a UDP-based reliable transport). My next step is to make it work with a ReST infrastructure. There doesn't exist something that'll work out-of-the-box. I'd love to b...

0
Q: Mongoose API get nested items in array by _id

Sizzles27I am building an api with Express and Mongoose (Backbone on the front). I have a Mongoose User model that contains an array called "orders". I need to set up a create method that will READ a Single Order by ID. When I navigate to: http://localhost:3000/test/ I get the following for a logged ...

 
12:31 AM
0
Q: Dynamically displaying JSON data in browser with node.js without refresh

AllTheTimeI have this simple node.js server that grabs JSON data from an external source and then displays it in a browser window. How can I make it update every minute (when the JSON is updated) automatically on the page without a refresh? Tangent: is there a better way to request and parse the JSON? I'm...

 
12:55 AM
0
Q: How can I have Node re process /etc/hosts?

Justin808So for unit testing I need to redirect a domain to a new IP for a specific machine. I've setup a route in node to update the machine's hosts file. exports.hosts = function hosts(req, res) { var domain = req.params.domain; var ip = req.params.ip; if (domain === 'localhost') { res.json(...

0
Q: Host grunt-triggered nodejs application inside IIS

user908645This might be a silly question, but I just get started with nodejs/grunt so please bear with me. I have a nodejs application that is normally triggered by typing in "grunt server --force" from windows command line. Now I want to host the same nodejs application inside IIS instead of command line...

 
1:38 AM
hello
 
0
Q: Schema field with accented character

guiomieWhen I insert in mongodb or print in the console prompt a new schema object, it seems like accented characters disappear for a question mark "?" ... am I missing something? var mongoose = require('mongoose'); var Schema = mongoose.Schema; var modelSchema = Schema({ firstName : { typ...

 
 
1 hour later…
3:09 AM
0
Q: Run C library from Node.js

pedalpeteI'm completely new to C, but have a small program (interfacing with hardware on RaspberryPi) that I'd like to be able to run from Node.js. From what I can make out in the Node.js docs, I can run a C++ program by exporting the program as a NODE_MODULE http://nodejs.org/api/addons.html I've been t...

0
Q: Node.js fs.watchFile, Is it possible for it to check for changes once and no more?

unableToCompilenew to node.js and just looking through the docs on the watchFile "module"? (I don't know if you call it module or method or whatever) My current code looks like so: var fs = require("fs"); console.log("Started"); var file = fs.readFileSync("./files/checked.txt"); console.log("Initial file con...

-1
Q: Node.js global modules not working

makadarelI am with a experiment with node. After I install nodemon globally and run it just open the default editor same thing after I installed express. It might be a problem with PATH or ENVIRONMENT on windows 8.1?

 
3:37 AM
0
Q: how to modify the nodejs request default timeout time?

MarsOnlyI was using nodejs request, the default timeout of nodejs http is 120000 ms, but it is not enough for me, while my response reaches 120000 ms, the console will display "POST /additem 200 120006ms" and the page shows error, so I want to modify it.but i don't know how.

0
Q: Laravel (Main Website) + Node (Scrapper) + DB

TIER 0011I am creating a website using the Laravel framework that requires the utilization of some data. This data is being collected by a scrapper implemented with Node.js. My approach is to collect the data and store it on a database (MongoDB) and read it with Laravel. I came across this solution but ...

 
4:05 AM
0
Q: how to build common api for web and mobile and authenticate with oauth

nomongoI'm trying to build common API which I'm planning to consume from various mobile native apps and website. If I were to authenticate users using facebook oauth, how should I design my APIs? What are the best practices and industry standards for providing same content on website and mobile? I'm usi...

 
4:23 AM
-2
Q: Hosting With Heroku

user3458519I want to host website on heroku .I am looking for tutorials that guide to host on keroku. The problem is I am having a Client folder running on apache at localhost and my server running on node.js at localhost. Now how I host both folders because on every tutorials there is a guide to host node....

 
4:57 AM
0
Q: jQuery slider not working in angularjs

TrialcoderMy slider wont come up on first time navigation of the page. However when I hard refresh the page then it comes up and also if I replace the <div ng-view></div> code with the front.html page content then also the slider starts working. Let me know what I am doing wrong in angular as I believe it ...

 
5:20 AM
0
Q: update (preferences)schema by connecting different schemas

DexterBrylleI'm new to node.JS/mongodb(mongoose). I've built an API that for my app to communicate to. One route it has is to set the user's preferences. Here is my model: preferenceModel.js var mongoose = require('mongoose'); module.exports = function() { this.collection = 'preferences'; this.schema = m...

 
6:09 AM
0
Q: Use OpenShift environment variable from nodejs

prismIts first time I am using OpenShift . But I dont find any document how to use nodejs to create a file in OPENSHIFT_TMP_DIR . Any idea?

0
Q: EACCES, mkdir '/usr/local/lib/node_modules/cordova'

Srikanth MI am Using cordova-3.4, While instlling cordova through CLI, i am getting the following errors, please suggest me, thanks. npm http GET https://registry.npmjs.org/cordova npm http 304 https://registry.npmjs.org/cordova npm ERR! Error: EACCES, mkdir '/usr/local/lib/node_modules/cordova' npm ERR! ...

 
6:21 AM
0
Q: Unzipping a password protected file in Node.js

CodySchaafIs there a library that I can use to unzip a password protected file (Site makes me put a password on the file when downloading it)? There are a ton of libraries to unzip normal files, but none that I can find that will do it with a password. HereI found some helpful starters. But I would rathe...

 
0
A: how to modify the nodejs request default timeout time?

SomeKittens Ux2666I'm assuming you're using express, given the logs you have in your question. The key is to set the timeout property on server (the following sets the timeout to one second, use whatever value you want): var server = app.listen(app.get('port'), function() { debug('Express server listening on p...

 
6:43 AM
0
Q: nodemon not working properly

Aj GauravdeepI currently run my nodejs app by npm start. I just installled nodemon by sudo npm install -g nodemon so that i can get my server restarted when i save changes to files. But now when i try to start the server, something like this nodemon ./app.js localhost 3000 or nodemon start localhost 3000 ...

0
Q: Node.js application crashing

rkmrI am just beginning with node.js and was trying to deploy Pusher's example authentication code but it fails Here is the code - var express = require( 'express' ); var Pusher = require( 'pusher' ); var app = express( express.logger() ); app.use( express.bodyParser() ); var pusher = new Pusher(...

0
Q: How to change the value properties with superagent syntax in nodejs?

user3686410Using superagent package in nodejs, I'm not sure about what I can do in .end(). I'm trying to alter the values of 'title' and 'description' after getting data in 'get' function, but they remains the same. Also when I tried to return the data.body[0].title in .end(), then var todo = new Todo(...

 
0
A: Node.js application crashing

SomeKittens Ux2666You have express 4 installed, but Pusher's docs are using an older version of express. Let's use morgan to replace the now-defunct express.logger(): var express = require( 'express' ); var Pusher = require( 'pusher' ); var logger = require('morgan'); var app = express( logger() ); app.use( exp...

 
0
Q: HTTP POST is submitting empty JSON array

djpATLSF$scope.submitBracket = function(item, event){ console.log("submitting form"); var jsonData = '{"userEmail" : "darwood@mail.com","brackets" :' + JSON.stringify($scope.allGames) + '}'; var testJSON = {"Hello": {"id": "file", "value": "WTF"}}; console.log(jsonData); var respo...

0
Q: Facebook event/feed API not returning data

user3492125Written in nodejs, the following piece of code is intended to retrieve lists of posts from a facebook event using facebook's graph API, but the response is always {"data":[]}. var graph = require('fbgraph'); var options = { timeout: 3000 , pool: { maxSockets: Infini...

 
7:01 AM
0
Q: nodemon not working properly

Aj GauravdeepI am running my nodejs app by npm start I just installed nodemon by sudo npm install -g nodemon so that i can get my server restarted when i save changes to files. But when i try to start the server, something like this nodemon ./app.js localhost 3000 or nodemon start localhost 3000 I get th...

 
7:13 AM
0
Q: i want a tutorial to retirieve the text data and image from mongodb using mongoose and express?

user3686508I am new to Express, mongoose and mongodb. I have stored the image and image info in mongodb and retrieve it. My problem is, i am not able to display it on web page both at a time? How can i do that? please help. Thanks in advance.

 
7:34 AM
0
Q: NodeJS + Cassandra + get triggers in nodejs application

PrakashI am new to this Big Data and Cassandra world. Would like to know if there is any reactive modules available in NodeJS? I read that there is some trigger mechanism in java but how do we get it in nodejs application? any suggestion or ideas would be very much helpful to me. Thank You.

0
Q: with node-webkit(or similar solution) - I want to implement C++ drawing on the specific area of HTML5 screen

sean kiI want to implement C++ drawing on the specific area of HTML5 screen. What do you think is the best solution? I found Node-webkit has node-webkit c++ module. That is also allowing to draw on HTML screen? If it is impossible, how about brackets-shell? brackets-shell has some c++ file such as appsh...

0
Q: Inserting in mongodb from nodejs big array of objects

user3386802I need to insert a big array of objects (about 1.5-2 millions) in mongodb from nodejs. How can i improve my inserting? my code: var sizeOfArray = arrayOfObjects.length; //sizeOfArray about 1.5-2 millions for(var i = 0; i < sizeOfResult; ++i) { newKey = { ...

 
8:12 AM
0
Q: Node.js + Mongoose.js How to get sum of orders are placed in a month or a week?

yong hoI find out the aggregate framework, but how to get the doucments in a month or a week? I am tring to calculate how many orders are placed in a week or in a month. The documents are like this: { "_id" : ObjectId("53834167b54a3b22f0079e2c"), "createdDate" : ISODate("2014-05-26T13:28:07.942...

0
Q: node.js web app not responding as it should be

rkmrI deployed pusher's authentication program code on heroku/virtual server. The server app starts up successfully but when a android mobile client tries to connect the following errors are diplayed on the console - TypeError: Cannot call method 'handle' of undefined at Function.app.handle (~/Mess...

 
8:29 AM
0
Q: How to install cassandra nodejs

Blane TownsendI have a linux ec2 instance on amazon and have installed cassandra. I then installed nodejs and used npm install node-cassandra-cql to install the cassandra part of nodejs. I have tried out the basic scripts that were given: //Creating a new connection pool to multiple hosts. var cql = requi...

0
Q: how to deploy a mongodb replicaset using nodejs script(Automation of replicaset deployment)

Shobhit MishraI have to deploy a replica set using nodeJS script.If I've to add or remove some member from replica set on a later instance of time then I should be able to do so using script. The problem is that I couldn't find any thing like db.initiate(config) similar to rs.initiate(config).will it be db.a...

0
Q: Is multiple delete available in sequelize?

SpunkyLiveI have a multiple contentIds. Mode.findAll({ where: { id: contentIds } }) After finding all how can I Delete multiple rows from a table. Or tell me other options to delete multiple records with a single query.

0
Q: Express.js project not recognizing some route addresses

XIMRXOther routes are working fine but for one route '/users' expected response is not being sent. Instead following error detail is sent. 500 Error: Forbidden at Object.exports.error (/home/node_modules/express/node_modules/connect/lib/utils.js:63:13) at createToken (/home/node_modules/expre...

0
Q: partial class methods in node.js using lodash?

AnnanI would like to create a function in node.js which takes an integer value and converts it into a binary string using lodash/underscore's _.partial/_.partialRight. var _ = require('lodash'); var n = 123456789; console.log(n.toString(2)); // works console.log(Number.prototype.toString.call(n, 2))...

0
Q: NOMP - Undefined string

user3686830I've done the instructions given at their github page: https://github.com/zone117x/node-open-mining-portal Now, I'm getting this error when I'm running undefined:1 Frs1QCJ","rewardRecipients":{"RrHHam7hYut6RnawbijVdA7j4nT3R67Eun":1,},"payment ...

0
Q: Mongoose Population ObjectId ref's are disappearing?

user3686773I've simplified the code below: var buySchema = new mongoose.Schema({ userid:String, timestamp:Number, price:Number }); var cardSchema = new mongoose.Schema({ cardid: String, buy:[{type:mongoose.Schema.Types.ObjectId, ref:Buy}], }); var Card = mongoose.model('cards',cardSche...

 
9:27 AM
0
Q: Setting session expire time - Sails.js

MahahariI have a web page that uses session variables. How can i set an expire time for a session? eg: after 15 minutes of inactivity , have to destroy the session. I tried in config/session.js , but in vain. As i am new to sails.js , please suggest how to achieve this. Please help. Thanks a lot.

 
9:45 AM
0
Q: WebSockets listening on UNIX domain socket?

Markus JohanssonIs it possible to setup a WebSockets server behind an nginx server which handles connections on a UNIX domain socket? I currently have several WebSocket server instances on the same machine and have the problem of port sharing. All instances must be allocated a unique port. I want to avoid that ...

0
Q: Metalsmith static site pages are missing metadata

James KhouryI've been attempting a tutorial to set up Metalsmith, and i've gotten to the end of part 1. I've install node.js and modules. The IDE is Visual Studio 2013 with Node.js tools installed. I've put a basic structure in and I'm trying to get a single page to render with a template. The instruction...

 
9:57 AM
0
Q: Is there a simple built-in way to convert output data in to formatted data in Node.js?

Jaydipsinhi've zmq implementation in node. i subscribe for one topic among all channels and got message in slow buffer object. if i directly print that message on console, i got something like this. <SlowBuffer 49 12 00 00 5a 00 00 00 00 00 00 00 00 00 00 01> so this is slowbuffer object containing raw...

0
Q: Why is an explicit return required in ExpressJS

Sebastian DahlgrenI have a small function like this: tierRouter.get( '/:id', passport.authenticate('basic', { session: false }), function (req, res) { Tier.findById(req.params.id, function (err, tier) { if (err) { res.json(500, { error: "Internal server error" }); } if (!tier) { return res.j...

 
10:14 AM
0
Q: Foundation new project : error

Spencer MarkI'm getting the following error when trying to create new project using foundation: user18-pc:vitalitydental.pmwsystems.co.uk Seb$ foundation new template /Library/Ruby/Site/1.8/rubygems/core_ext/kernel_require.rb:55:in gem_original_require': /Library/Ruby/Gems/1.8/gems/foundation-1.0.4/lib...

0
Q: Node/NPM: Can one npm package expose more than one file?

JohnSI have made a JS library for web development, it consists of several modules, which build up multiple distribution builds. It's fine when it is distributed over cdn or for example using Bower. But now I'm trying to publish it with NPM so that it can be consumed using Browserify. My question is...

 
10:48 AM
0
Q: Protractor is not recognized as an internal or external command, operable program or batch file

rohit_kadamI have protractor installed on windows slave machine. I am trying to run my script using node index.js. If I trigger job from jenkins to run above command it gives error like Protractor is not recognized as an internal or external command, operable program or batch file.. But when I run command d...

 
11:06 AM
0
Q: NodeJs not staying live in aws

user2302244I have deployed a Bitnami AMI of NodeJs on an AWS micro instance. After starting my node app, everything works fine. After some time without any activity, the app which is attached to port :3000, seems to shut down. When this happens on refreshing the page my browser gives the message: 'Networ...

0
Q: dynamically set countries for supported locales in express application

khinesteri am using node-cldr library (https://github.com/papandreou/node-cldr) for localization and have an options list for the countries, http://pastebin.com/jyM5pCLn territoriesList = cldr.extractTerritoryDisplayNames('en') countries = _(territoriesList) .pairs() .filter (...

0
Q: Mongoose data base connection/disconnection. Error

trololoHow to close the connection of mongoDB using NodeJS? mongoose.connect(config.get('mongoose:uri')); this.db = mongoose.connection; var schema = new mongoose.Schema({name:String}); var User = mongoose.model(dbUserName, schema); mongoose.disconnect(function () {console.log('db c...

0
Q: Sails JS Waterline join of multiple models

Sandro AdamiaHi i'm trying to join multiple tables with populate method, i googled and couldn't find efficient way of doing it, i do not want to query db several times to build the result, is it possible to solve it with sails version "~0.10.0-rc7" i'm building quit big project with more then hundred of tabl...

 
11:41 AM
0
Q: node app 404 when trying to transfer to iisnode

LerpI am trying to transfer a nodejs app from my development machine to our IIS server. It runs perfectly fine on my machine but I am always getting 404s when I transfer it to IIS. The directory structure is like so: C:\Programs Files\iisnode\wwww └ mysite ├ public │ ├ app │ ├ css │ ├ js ...

 
12:07 PM
0
Q: Execute code in a sandbox, with modules in same context

Andy EI'm automating running the ECMA-402 test suite against the Intl polyfill I wrote, and I've hit some problems. Currently, the tests are run against a fully-built version of the library, which means having to recompile every time a change is made before the tests can run. I'm trying to improve it...

0
Q: Node.js segfault - What does the stacktrace mean?

MartinI've got a node (version: v0.10.28) server running which stops from time to time without an exception. The kern.log (linux debian) shows this errors: May 28 05:01:20 pro1739 kernel: [29083831.961652] node[32519]: segfault at 0 ip (null) sp 00007fff520fa478 error 14 in node[400000+80d0...

0
Q: Is it possible to set MongoDB data into latex template

ABarikI am creating pdf file with latex template, nodeJS and MongoDB. I have successfully implement the latex template in nodeJS. Now Problem is that I want to write template field with mongo data but facing problem to insert data in the templates. if you have any idea regarding it then share it.

 
12:30 PM
-1
Q: How to convert nodejs to express?

user3437333Please help me to convert following application express i've tried a lot but didn't got how to convert completely into app with express var http = require('http'), url = require('url'); var fs = require('fs'), sys = require('sys'), exec = require('child_process').exec; var port ...

 
12:42 PM
0
Q: Set the SUT for npm package tests

duncanhallI'm trying to add some tests to an NPM package. The package I am building is a simple polyfill. I have a set of mocha tests that are run when I call npm test. However, they all fail because the very polyfill I am building has not been applied. This is a simplified example of the tests I am runn...

0
Q: How Would I Build A NodeJS Websocket Server Without A Library

CharlieI've recently built a small JSON webservice in NodeJS, and am interested extending it to accept requests via WebSockets. Most of the WebSocket tutorials I have found so far are based on 3rd party modules like SocketIO. What does it take to write a websocket server? Assume that cross-browser com...

0
Q: /bower_components doesn’t load dependencies on the page

Green/bower_components doesn’t work. I get GET /bower_components/jquery/jquery.js 404 My configuration is as described in Bower documentation: app.use(express.static(path.join(__dirname, 'public'))); app.use('/bower_components', express.static(__dirname + '/bower_components')); In my .html file...

0
Q: How to run node in Emacs on GNU/Linux

jcubicI've try the solution from this question how to run node.js interactively in Emacs on Windows but instead of prompt from node I've got this: ^[[1G^[[0J> ^[[3G and nothing happen when I press enter. I've also try to run node in ansi-term but when I press backspace I've end up with: > asdads> a...

 
1:00 PM
0
Q: mongodb - folder tree hierarchy

user2491336Every folder in the structure has an ancestor id list. When I move a folder to a new parent, I have to update all children with the new ancestors: // root folder { id: 1, name: "folder 1", ancestorIds: [] } // child of folder 1 { id: 2 name: "folder 2", ...

-1
Q: How to debug NodeJS C++ module in Microsoft Visual Studio?

3y3I configured my NodeJS C++ module with help of node-gyp configure, next I open it in Visual Studio 2013 and successfully build it, but I can't understand how to debug this module. Is there any solution links? The best will be tutorial "How to start develop node js c++ module with help of MSVC"...

0
Q: Haraka as smtp server

KelooI tried to use Haraka as smtp server. http://haraka.github.io/ sending emails from console was successful but I can't connect to it from my computer my computer response: { [SenderError: Mail from command failed - 550 Authentication required] name: 'SenderError', data: '550 Authentica...

 
1:30 PM
0
Q: how to read nodejs internal profiler tick-processor output

nathan gi'm interested in profiling my nodejs application. i've started it with --prof flag, and obtained a v8.log file. i've taken the windows-tick-processor and obtained a supposedly human readable profiling log. at the bottom of the question are a few a small excerpts from the log file, which i am com...

 
1:42 PM
0
Q: Issues with links/text assertions using PhantomJS with Selenium

user2686371I have been using Phantomjs (v 1.9.7) with selenium web driver, as part of my Behat/Mink BDD testing process. However now Phantomjs has problems with finding links and texts on page. I know it is phantomjs issue, as when I run tests using firefox as selenium client, the tests run fine. I rememb...

-5
Q: A short Php Code to Node.js

user3687734How to change this Php code to node.js ,Thks . 如何将这段php代码改成node.js,我想了30分钟也没有搞定。 <?php //echo(rand(1000,90000)); //echo(rand(15000,999999)); require 'config.inc.php'; require 'db.php'; function GetRandNum(){ return (rand(15000,999999)); } $idtemp=GetRandNum(); while(!isset($repeat)){ $que...

0
Q: What is the best way to generate a query screen from a model

P HemansI have a number of reports each has one or more associated queries. So an example might be; client == "selected_client" and items > entered_number In the desktop version of my application I had rendered screens by parsing the expression and on the basis of metadata. So the user would see a scr...

 
2:04 PM
0
Q: access MTP devices storage service on local windows system from node.js

JoniFor an application that I am developing in node.js I would like to access storage on MTP devices (android/iphone?) connected through USB to a local Windows 7/8 machine. Does anyone know of an easy way to do that? I could not find any node module that supports that. Am I right to understand that ...

0
Q: Transfer entire directory using ssh2 in Nodejs

Andrew WhalleyI'm just wondering whether it is at all possible to transfer a directory from a unix server to my local machine using the ssh2 module in node.js. I have connected to the remote host and can read the directory as well as transfer single files, but there are 28 folders in the directory which each c...

 
2:16 PM
0
Q: Nodejs for-loops and wait until loop finished

rubiktubikI have the following code: //Marks all users which are reading the book with the bookId var markAsReading = function (bookId,cb) { User.find({}, function (err,users) { if(err) cb(err); //Go through all users with lodash each function _(users).each(fun...

0
Q: NodeJS file Delete/Copy

Sid7201function _deleteFile(fileName) { var mediaDetails = _mediaDetails(fileName); if (fs.existsSync(mediaDetails.filePathToBeDeleted)) { fs.unlink(mediaDetails.filePathToBeDeleted); log.info('[Media Files] - finished deleting: ' + mediaDetails.filePathToBeDeleted); } } ...

0
Q: upload and get chunks from GridFS (mongodb)

Or SmithI'm new in mongoDB, and I try to upload a file to GridFS with chunks. Meaning, I get a file from my client divided into chunks, and I want to upload it to mongoDB. How can I do it? and how I can get this file (which again, divided into parts in my mongo.db. is the Id would be the same?) The ap...

0
Q: parallel DB requests to Couchbase from Node.js SDK

Meta_Is_BettaI am hoping to fire off several Get requests to Couchbase store in a short time span, say in a half a millisecond. I can't use a multiGet because I don't have all the keys at the same time. However, if I fire off several separate get requests shortly after one another, I believe they will proce...

-1
Q: Github API, get stats of a user for a repo

user1934044I'm working with gitub api in meteor and I'm using the "mikedebeor" node package You can find the docs here http://mikedeboer.github.io/node-github/ Now, I want to know how many number of lines added and deleted by a author for a repo. While I find stats returns for single commit 'sha' , I wa...

0
Q: Nodejistu deploy error

Alex coadyI have a Nodejitsu app that I've been able to successfully a bunch of times previously. My last deploy was about 2 weeks ago. I went to deploy yesterday and again today and got an error that isn't really giving me enough information to find and resolve the issue. The console output (after the out...

0
Q: Restify GET Request returns response cookie but not written in browser

MattijsI have build a REST Api in Node.js using Restify which works like a charm. One of the REST Endpoints, a GET, does some stuff and then returns result back to the caller with a Set-Cookie in the header. When I run call the endpoint directly in my browser on http://127.0.0.1/theEnd I receive a cook...

0
Q: Openshift hot_deploy marker is ignored

user3247194I have a custom nodejs-0.10 app on Openshift (from here: https://github.com/engineersamuel/openshift-origin-cartridge-nodejs). Several months ago I added the hot_deploy marker to my repo as outlined here: https://www.openshift.com/kb/kb-e1057-how-can-i-deploy-my-application-without-having-to-res...

 
3:13 PM
0
Q: Nodewebkit app: hide cursor

VelthuneI'm developing my web app with nodewebkit in fullscreen mode. It has to be used with touchscreen monitor. I've used CSS proprerty: html * { cursor: none; } In nodewebkit's manifest seems that nothing usefull is provided to remove cursor.. Problem is that cursor disappears only when it is m...

0
Q: Express - Session cannot set session variable after response has been sent?

rahulgIn my code time wise, res.send is called before setting a session variable(req.session.variable) is set in express-session. Something like this app.get('/test', function(req, res) { FB.api('/', function(fbResponse) { req.session.variable = 100; }); res.send('test'); }); Now this, wo...

 
3:46 PM
0
Q: Paths property of module object?

asaini007When I print any module's module object to the console, I get output such as the following: { id: '.', exports: {}, parent: null, filename: '/Users/myname/audiooutput/bin/audiomodule.js', loaded: false, children: [...], // array of module objects, omitted for brevity paths: // what i...

 
4:05 PM
0
Q: Unable to install bower on Openshift

prasunI am unable to install bower on Openshift. I keep on getting errors like remote: npm ERR! Error: ENOENT, lstat '/var/lib/openshift/537xxxxcd/app-root/runtime/repo/node_modules/bower/node_modules/mout/array/intersection.js'[K remote: npm ERR! If you need help, you may report this log at:[K remote...

0
Q: Restarted a node app with supertest

Robert MoskalI often write black box tests against my node applications using supertest. The app loads up database fixtures and the black box tests exercise the database strenuously. I'd like to reset the app state between certain tests (so I can run different combinations of tests without having to worry ab...

1
Q: Offseting the content in Angular

user19882Is there a way to have the offcanvas offset my content without actually putting the entirety of my content inside it? What I mean is, in order of the offcanvas to offset the main content this has to be inside the offcanvas inner-wrap div, however, with angular, this could be difficult to impleme...

 
4:25 PM
0
Q: node-ffi : Dynamic Linking Error

WellWellWellI have a C++ method (which role is killing some processes), in a library Risk.dll. On the other hand, I am developing a web-application (using Nodejs and AngularJS), running on Google Chrome. When I click on a button through the browser, I would like to be able to call the C++ function, through ...

 
4:43 PM
0
Q: Mongoose find use result in the main code

user3491456var mongoose = require('mongoose'); var result = false; thecollecton.findOne({name: "hey"}, function(err,obj) { if(err) console.log(err); if(obj) result=true; }); console.log(result); And... it doesn't work (and I know why). How can I make it works ?

 
5:06 PM
0
Q: how to resolve error in sub documents mongoose/express

user3665192I am developing a web application based on the Mean Stack, but I have a care with Add and Edit operations, particularly with sub documents of the Field "order", the console tells me that "reference" is undefined on the line "order.reference" : req.body.order.reference, , I don't know how to...

0
Q: How do I run ghost blog inside exsting node.js application on Azure?

AlexHow can I run an instance of Ghost under an existing node.js express application (like this: {my domain}/blog)? I'm using Azure Websites to host the site.

0
Q: this.async() in yeoman-generator

BensonI am learning how to write a yeoman-generator. I have a question regarding the code below. It says by adding var done = this.async(); and call the method later in callback, we can make the function askFor() a asynchronized function. Could someone please explain why? askFor: function() { var ...

0
Q: Saving an image using node (fs writeStreams) inserts headers into file

ToadumsI am trying to upload a photo (in a multipart form) from an iOS app, using AFNetworking. I am using node.js for my backend, and almost have it working. The problem is that when I am trying to save the image it is also writing the headers to the file...So all of the images I save have something li...

0
Q: Uninstalling bower installed with a different version of npm

DbuggerI have an Ubuntu 14.04 system. I had installed npm and I installed bower using sudo npm install -g bower Some time after that I realized that I was using the node and npm that came fromt he ubuntu repositories, so to use the latest one, I added the repository: sudo add-apt-repository ppa:chri...

 
5:34 PM
0
Q: Node JS: Listening for HTTPS POST JSON Requests

dpigeraI currently have a network server that is posting information to me as JSON payloads to a specific URL endpoint. The specification states I need to standup an HTTPS server that can listen for POST JSON requests. I've created the simple Node JS listener shown below. I can confirm the request i...

0
Q: "Node.js / Edge.js - Insert JS variables into SQL" part 2

augustHere's the original question. Okay, I'm using Node.js and Edge.js to insert values to an SQL database. First attempt was a straightforward insertion of hardcoded values. var insertRow = edge.func('sql', function () {/* INSERT INTO dbo.table (column0, column1, column2) VALUES (value0, ...

0
Q: express.js symlink url to different url

Balu Loganathanis it possible with express.js to symlink a url to different url. ex: http://localhost:3000/analytics/src/dev/#dashboard should be sym linked to http://localhost:3000/analytics/#dashboard Please let me know if it is possible.

 
6:05 PM
0
Q: Socket.io loading very slow

user3093010First time then i run web server my main page loading about 25 s and then i remove this line: <script src="/socket.io/socket.io.js" type="text/javascript"> </script> my page is working fine. So why socket.io is so slow ? `var app = express() , server = require('http').createServer(app) , io...

0
Q: Writing MongoDB result to file using native Node.js driver

JimGI am trying to write the results of a MongoDB query to a file using the native Node.js driver. My code is: var query = require('./queries.js'); var fs = require('fs'); var MongoClient = require('mongodb').MongoClient; MongoClient.connect("mongodb://localhost:27017/test", function(err, db) { ...

 
6:17 PM
0
Q: Not seeing latest version when updating Node.js via installer (MSI) Windows 7

magenta placentaI'm trying to update node on my Windows 7 box but I'm not seeing the latest version after I re-install/update node. I'm just going out to http://nodejs.org/download/ and getting the latest Windows installer, v0.10.28. I then just run that installer where it defaults to installing everything on ...

0
Q: Returning variables from a callback function - MongooseJS virtual

viliThis question has been asked a lot of times, but I can't find a satisfactory answer. UserSchema.virtual('accountinfo').get(function () { var data = { a: 0, b: 0 }; Trade.find({usr: this.username}, function(err, trades) { data.a = 10; data.b = 20; retur...

 
6:34 PM
0
Q: Render hoedown in javascript without Node.js

toogyI'm working with django (python web framework) on a project where users can input hoedown, which is then converted to HTML and stored in the database. This is pretty basic stuff but I would like to allow the user to preview his input in live (so definitely using javascript). I also thought abou...

 
6:52 PM
0
Q: How to wrap child_process.spawn events in a Promise?

Noah GoodrichGiven the following: var spawn = require('child_process').spawn; var Promise = require('bluebird'); var call = function() { var p = Promise.defer(); var proc = spawn('echo', ['Hello World']); var rs = ''; proc.stdout.on('data', function(data) { rs += data; }); proc.stdout.on('...

0
Q: Returning a string value from a promise

Russell ChristopherIn the code below, you see me making an HTTP request. I parse the response and pull out and a "token" (a string) . I want to return that token so that its value is assigned to foo. foo = request.post( { url: 'http://10.211.55.4/api/2.0/auth/signin', body: reqLogin...

0
Q: Documents not being stored in full in MongoDB

Daniel LeachI am working on a project for a client. This project consists of multiple pages of form inputs that are used as an online application. I am using NodeJS and MongoDB for server communication and storage. The online applications that are submitted are stored in MongoDB as individual documents. ...

 
7:21 PM
1
Q: npm install couldnt install angularjs libraries

rajuI have installed mean.io and ran sudo npm install. Actually following commands in sequence sudo npm install -g meanio mean init yourNewApp cd yourNewApp sudo npm install -g bower sudo npm install It is supposed to download and install angularjs libraries into public/system/lib. After doing the...

0
Q: Mongodb find and sort?

Michael Joseph AubryI have researched this question but have a few minor questions that apply to my personal project. I read Mongodb find and sort and a few stackoverflow posts. Here is my question though, take a look at my code. // this is my original code, for some reason the messages are getting out of order /...

0
Q: Mongoose - setting virtuals via return on callback function

viliI see similar questions posted all over stackoverflow, but can't seem to find a satisfactory answer. I'm using MongooseJS as my ODM and I'm trying to set up virtual getters than query, analyze and return information from a different collection. Unfortunately, (because of nodejs asynchronous na...

 
8:03 PM
0
Q: Refusing to delete bin nodejs

Alessandro MinoccheriI would like to start to create an npm package, so I have create my package.json, index file and cli file. When inside my directory I launch sudo npm install . -g return me this error: ERR! error rolling back Error: Refusing to delete: /usr/local/bin/package-info not in /usr/local/lib/node_m...

0
Q: Should we worry about SQL Injection in the generic way while using Node js?

rahulgRecently, moved from PHP to node js, so am curious as such there is no proper support for stripslashes to avoid SQL Injection. So, what are the methods to protect my self from SQL injection in node js

 
8:20 PM
0
Q: Control flow of an IF statement & Asynchronous function

C0derMy code is structured as follows: IF (something) { ..stuff ..Asynchronous Function Call } ELSE (something) { ..stuff ..Asynchronous Function Call } ..more stuff My question is that, lets say the IF condition is met, the code executes 'stuff', then moves onto the Asynchronous Function Call. Will...

0
Q: Changing localhost server files are served from using Node (Webstorm /maybe IntelliJ)

wootscootinboogieI'm not sure what I'm missing here, so hopefully someone can help me out. I'm working on a project where we're using Node and in the Run/Edit configurations I've down the following: Node interpreter: This is the path to the node.exe file which I checked out from Subversion Working directory: ...

0
Q: SailsJS postgres native query date comparison

mandeep_m91I am facing an issue while running a native SQL query on SailsJS. The query I want to execute is SELECT a.kind, a.user, a.detail FROM activity a, followee b , users u WHERE a.user = b.followee AND b.user = u.id AND b.user = req.user.id AND a."createdAt" > u."updatedAt"; Now, in Sails cont...

 
8:42 PM
0
Q: Jade euro symbol output

EgidiusI'm using grunt-contrib-jade and I would like to output an HTML (euro) symbol from my locals.json, like: div!= content The exclamation mark should leave the variable unescaped the manual says, but still it converts my euro symbol to an â. Help would be much obliged

 
8:55 PM
0
Q: Extremely Poor Performance for Basic Node.js Service on OSX

rdeggesI'm relatively new to Node.js (been playing with it for a while, but just starting to use it for serious stuff). I was experiencing some very odd benchmark behavior when testing locally, and decided to build the most basic possible HTTP server and benchmark it with Apache Benchmark (ab). Here's ...

0
Q: REST API - DELETE with Express, Backbone and Mongoose

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 ...

 
9:12 PM
0
Q: How to add unique id to sub-document in a document in mongoose

monicalHow to add unique id to sub-document in a document in mongoose. My mongoose model sub document is not adding object id.

0
Q: Send file AND html page?

WesI'm using express to create a link where users download a file. Once click the link, the file downloads to their computer. For that I'm using: res.download('filename.pdf'); Easy. Is is possible to either redirect them to another page or send an html page along as well? Not sure web server...

0
Q: SailsJs 0.10: User.findOne(id) returning null for unique primary key

sinθI have the following user model: var model = module.exports = { autoPK: false, attributes: { id: { type: 'string', primaryKey: true }, email: { type: 'string', required: true }, hash: { type: 'string', required: true ...

 
9:29 PM
0
Q: Node.js - How can I use my local variable with EJS view

JohnI try to used my local variable on EJS. It's just a varaiable to check if the user is connected. -> Like the last post on this link: How to know if user is logged in with passport.js So, app.js app.use(function (req, res, next) { res.locals.login = req.isAuthenticated(); next(); }); ...

 
9:41 PM
0
Q: Node.js check if path is directory error

asaini007I'm trying to use this answer to allow me to check if a given file path is a directory, however I get the following error: fs.js:679 return binding.lstat(pathModule._makeLong(path)); ^ Error: ENOENT, no such file or directory '.DS_Store' at Object.fs.lstatSync (fs.js:679:1...

 
9:57 PM
0
Q: Wrap library with thunkify for co

dreI was wondering how to thunkify (wrap in thunk) a library for use with co. The library is like the following. All the Client calls use other objects in the library. Library.Client = function(opts) { } Library.Client.prototype.createList = function(opts, cb) { options.client = this; var lis...

 
10:09 PM
0
Q: Socket.io server not working

user3169790I've got a Socket.io server that is not working (it shows the following error on Firebug and of course it doesn't any of its functions): GET http://www.example.com:1618/socket.io/1/?t=1401400488401 400 Bad Request 35ms Also, when I try to run the server, it outputs that: events.js:72 thro...

 
 
1 hour later…
11:24 PM
0
Q: Why can't i use AngularJS' ng-view and routing in combination with jade?

user1666419So i'm currently trying to learn about the MEAN stack. Express uses jade by default and although i know i can just as easily use html i thought i would try it out. Now, when i try to route with angular like this: ... body div(ng-view) script. var app = angular.module('myApp', ['ngRoute'...

0
Q: Iterate over sockets in socket.io v1? "...has no method 'clients'"

JVE999Before I was able to write something like this: io.sockets.clients().forEach(function (socket) { socket.emit(signal,data); }); Now, I cannot and I get the error Object #<Namespace> has no method 'clients' Is there another way to do this? This is with socket v1.0. (or 1.0.2 I think). Fo...

0
Q: Error during WebSocket handshake: Status line contains embedded null (using livereload, node-inspector, and karma)

Benjamin PowersWhenever I use something in my Terminal that requires a websocket to Chrome (livereload, node-inspector, karma, I get the following console error "Error during WebSocket handshake: Status line contains embedded null" Not sure if this is the right place to ask this question, but any help would be...

 
11:39 PM
0
Q: Session Store and Socket.IO in Kraken.js

user1440445I have a problem with Kraken. I also wrote them an issue, but it seems, they are not answering, and I really need an answer. I would like to join sessions with Socket.IO. I started with this answer, but I realized pretty soon, I need to connect Socket.IO with my Kraken's sessions. So I found thi...

0
Q: How to send the request object in NodeJS

Ishan RaychaudhuriI want to do something like this but this is throwing an error and I can't seem to use JSON.stringify either. Is there a way to do this? var http = require('http') http.createServer(function(req, res) { res.end(req); }).listen(3000);

 

« first day (12 days earlier)      last day (65 days later) »