« first day (58 days earlier)      last day (19 days later) » 

12:07 AM
0
Q: Multiple Nodejs Instance - Script Check

JerryFoxI am running some problems when testing my node server with a few hundred instances of node peers. I am scripting my test with the following: # Start Server node server $1 $2 & # Open up instances of viewer based on user input for i in `seq 1 $2` do sleep 1 node peer.js & done ...

 
12:47 AM
0
Q: How can I stream an image from node-webshot to filepicker

nearpointNode webshot is used to take a picture of an external website. The node webshot API is: var webshot = require('webshot'); var fs = require('fs'); webshot('google.com', function(err, renderStream) { var file = fs.createWriteStream('google.png', {encoding: 'binary'}); renderStream.on('d...

 
1:07 AM
0
Q: LibreOffice (soffice) command line stuck when executed as a node child process

Coffee BiteI am running headless, command-line libreoffice to convert documents to pdf or png. I am running. E.g. soffice --headless --convert-to png --outdir /tmp /tmp/myfile.pub The conversion happens successfully when I run the command on the command line directly. However, if I run it by spawning (or...

 
1:38 AM
0
Q: Minimal working Polymer example

Julien SillandI've been trying to get an extremely minimal web page using Polymer to simply render in the browser - I'm using a Node/ExpressJS/Jade setup on the server-side of things. My code is as close as it gets to the examples that ship with the Polymer documentation, I think I'm missing something really s...

0
Q: Unable to install modules by npm command

Risk JunkI was trying to running an example of node.js which requires the module uglify-js and the error info will be shown if the module does not exist: module.js:340 throw err; ^ Error: Cannot find module 'source-map' at Function.Module._resolveFilename (module.js:338:15) at Funct...

0
Q: Nodejs Session Variable

cberkayWhat is the best way of storing a session variable in node.js? Session variable as in it won't expire until the browser is closed. I am also using express.js and tried: app.use(session({secret: 'keyboard cat'})); req.session.order = 'variable; console.log(req.session.order); but it is expiring...

 
2:15 AM
0
Q: Can't retreive just names from the database using mongoose

user2537537I would like to get the value of all the name keys inside my database. I only have one key (field) which is the "name" key in each document of the db. here is the code. The code I need help with the most is towards the bottom starting with user.find({}, 'name', function(err, users){... when i ...

 
2:29 AM
0
Q: node.js cannot parse ISOString date?

Eugene YuWe store every date data in ISO format using new Date().toISOString(). I tried to convert this ISO formatted date into Date object in node.js but I get Invalid Date response. date string is isoDate = 2014-07-09T14:00:00.000Z and I did console.log on Date.parse(isoDate); and new Date(isoDate); b...

 
2:48 AM
0
Q: find function in mongodb and literal objects

Tal Wasermani use mongoos on nodeJS and i have the following schema in mongoDB: var users = new Schema({ local: { user_uuid: String ,user_name: String ,password: String ,email: String ,connectionKey: String } }); And i'm exporting...

0
Q: If I install Linux, Apache, MySQL, and PHP individually by hand, have I installed a LAMP stack? Or just LAMP?

justwonderingMy buddy and I have a dispute as to the usage of the word "stack." I'll call ourselves Bob and Fred. Bob thinks a "LAMP stack" is a distributed package including Linux, Apache, MySQL, PHP, and all of their dependencies compiled together in binary form for installation, and for which updating any...

 
3:38 AM
0
Q: Meanjs built in app, how to update USER array from articles module

user3835397I'm using the Articles and Users implementation into Meanjs built-in app. List of articles (View) with the button for every item: <div class="list-group"> <a data-ng-repeat="article in articles" class="list-group-item"> <button data-ng-controller="MyArticlesController" data-ng-click...

 
3:59 AM
0
Q: Node.js disable chunked Transfer-Encoding

remusI'm missing a content-length header on my response from a Node server that I'm piping a .zip file from another location. I've injected a content-length header via the code below, but still it seems the transfer-encoding: chunked is overwriting it somehow. Response Headers HTTP/1.1 200 OK access...

0
Q: PassportJS and Facebook Opengraph api version 2.0 Error

BrianI just started using the passport library recently and am a total noob. However, when I'm using my newly created facebook app to login I get the following error: 500 FacebookGraphAPIError: (#12) username is deprecated for versions v2.0 and higher at /app/node_modules/passport-facebook/lib/strat...

 
4:54 AM
0
Q: Stop mongoose connection

Sameh KamalI'm creating an a terminal application that uses mongoose for single insert and read operation per execution. I use the following code as a database util for my app require '../objs/' mongoose = require 'mongoose' class DbManager constructor: (@dbname="daftar") -> # static memb...

 
5:12 AM
0
Q: "Error: bind EAFNOSUPPORT" when trying to use udp6

MoakI have a script running smoothly on one server // create a new UDP server dgram = require('dgram'); server = dgram.createSocket('udp6'); server.bind(20500,config.server.ip); on the second server executing the code throws an error: "Error: bind EAFNOSUPPORT" node version is v0.10.26 on both ...

 
5:45 AM
0
Q: Confusion regarding maxSockets option in Nodejs

Vikram GoyalI have a nodejs application, wherein I make API calls to another service. I am using the request module of nodejs to do this. I have set a value of maxSockets to ensure that more number of concurrent requests can be made to the API. I have two doubts: 1. For how long does a socket used to make th...

0
Q: Socket.io not responding, Node.js

user3251849I'm moving my code to a server. This code works and renders database information perfectly on my own server I set up on localhost, however an error from index.html stating "io is not defined" displays when I run the code from my server. For whatever reason socket.io is not being recognized. Also,...

 
6:11 AM
0
Q: How do these functions work -- buildfn and response2console?

melonyI am struggling to understand how these 2 functions work. I understand these have something to do with "closures"? The code is here: var buildfn = function(csvfile, headers) { var response2console = function(result, response) { if (result instanceof Error) { console.error('Error:...

 
6:23 AM
0
Q: Nodejs Protractor + Jasmine + JUnitXmlReporter runs the test but without waiting for the browser

chulianIm doing end to end testing of a Angular website using protractor, but wanted to export the results to a file that Jenkins can read (JUnitXmlReporter), so for this to work I need to do a "simple change" to my protractor config file on the "onPrepare": exports.config = { // Do not start a Selen...

 
6:38 AM
-1
Q: Jsdom webscrapping

BabarSorry if it is too basic. I want to scrape a website which involves clicking links on page, and getting the resulting HTML. I read about the nodejs module called JSDOM which I suppose is built just for this purpose. Can anyone please direct me in the right direction (blogs or some documentation)...

 
7:02 AM
0
Q: Error while running sample android project with PhoneGap

GirishI'm on 32-bit Ubuntu 12.10. To start development with PhoneGap I installed node.js, java, ant and phonegap itself. I used $ phonegap create path/to/my-app to create a sample app. When I run this app using $ cd my-app $ phonegap run android I get the following errors: Error: An error oc...

 
7:26 AM
0
Q: Nginx ignores following config for first server_name

Benedict LewisI have a really odd problem with my Nginx configuration. I have a few Node.js apps running on my server, so use Nginx's proxy_pass to show them for certain domains. This is the config for one: server { listen 80; server_name v2.example.com i.v2.example.com; location / { pr...

 
7:38 AM
0
Q: File isn't being created. But is possible to read temporary file

Abner Soares Alves JuniorI have an file upload with ExpressJS and connect-multiparty. Temporary file is being uploaded, but isn't writed to the new place. fs.readFile(file.path, function (err, data) { console.log(file.path); var imageName = file.name; /// If there's an error if(!imageNam...

 
8:17 AM
0
Q: $geoNear aggregate returning empty set (nodejs)

user3791927I'm trying to execute a simple aggregate command. Here is a code db.collection('servicereg').aggregate([ { $geoNear : { near : [ -121.9181731, 37.4544319 ], distanceField : "dist", maxDistance : 500000, // query: { "servdescription": { $regex: "need" } }, ...

0
Q: mongoose virtual attribute not populating in some cases where populate() is used

chovyI'm trying to populate the job.creator and use the virtual attribute from the User object (user.profile) to give only public information for the job creator. /** * User Schema */ var UserSchema = new Schema({ favorites: { jobs: [{ type: Schema.ObjectId, ref: 'Job', index: true }] ...

0
Q: htttp auth with node and express

wazzadayI have set up http auth on my express website however I only want one specific url to be authenticated. '/admin'. Currently all area's require authentication other than the root, which is odd. My Code: var auth = require("http-auth"); var basic = auth.basic({ authRealm: "Private area", ...

-1
Q: Best strategy to work with NodeJs librtaries updates?

sensorarioI was working in a script with express, path, socket.io, ... I started this project few month ago. Since I did not have much time to work on it, after a while (few month), some libraries were updated but my package.json was not. For example, I was working with socket.io 0.9 and watching document...

 
8:59 AM
0
Q: mongodb setting up a database password

hello mtyjI read through several docs on mongodb but I'm so confused that I'm posting this question. Is there a way to set a password for a mongodb database? That ways when I try to open the database via console or connect using mongoose/node.js I will need a password. Thank you.

0
Q: Get parameter value from json object in node.js

Amit RajI wrote a code in node.js to get data from client through http request using POST method in which client send the json object. Client uses name value pair 'data','json_object' to send.Following is my code snippet: if(request.method=='POST') { var body=''; request.on('data', function (da...

 
9:11 AM
0
Q: Live streaming multiple bitrates with FFmpeg and node.js

user2757842I am looking for an efficient way of transcoding a live stream and breaking it up into different bit rates, I have it working as of now but I have to state each time which video I would like to address as well as each different bit rate, example below: var spawn = require('child_process').spawn;...

0
Q: Parse.com LinkedIn integration with Node.js

th0rvI'm trying to use People Search API from Parse.com with Node.js, but I have only 401 error code for response. Please tell me, should I pass any keys with request and how could I do it? My code for request is: Parse.Cloud.httpRequest({ method: 'GET', url: 'https://api.linkedin.com/v1/people/~:(i...

0
Q: how to bind `ws` message event twice and unbind the first one

Ken OKABEI use ws for node websocket client. I need to bind on the client stream twice, and later, unbind the first stream. var WebSocketServer = require('ws').Server; var wss = new WebSocketServer( { port: 9998 }); wss.on('connection', function(ws) //for every DLL websocket { var wsTL = functi...

0
Q: Error: can't find any special indices 2d (needs index) 2dsphere (needs index)

user3545212When i use this find command on heroku cloud server: users.find({$and: [ {loc: { $nearSphere: user.loc.coordinates, $maxDistance: user.dis / 3959}}, {age: {$gte: user.age_down}}, {age: {$lte: user.age_up}}, {gender: user.interested}, {interested: user.gender}]}) i get the can't fi...

0
Q: Creating multiple signed url for multiple objects of AWS S3

Dhiraj SharmaCan we create multiple signed URL of S3(AWS), for multiple object in single request in node.js. Suppose there is a need to generate 100 signed URL for accessing 100 objects and for that we are using getSignedUrl() function of AWS -sdk which is called 100 times. Can we do it in an optimize manner...

 
9:41 AM
0
Q: detecting node.js http.get calls that take long time

sumekA handler that makes multiple http calls to render a page takes a long time to return. I'd like to detect which of the calls take long time to complete. A profiling approach that I've found via googling[1] doesn't work on Mac OSX seems involved displays way too detailed information for my needs...

 
10:02 AM
0
Q: Not able to require a node module

user3069394I'm new to node js and require js. I installed a node module via npm install(https://www.npmjs.org/package/box-view). The node_modules folder has a box-view/index.js containing: module.exports = { BoxView: BoxView, createClient: function (key) { return new BoxView(key); } }; When I tr...

 
10:26 AM
0
Q: Javascript set callbacks in a loop

GingerJimI do not know how js engine handle the difference between two scripts below: var a = []; for (i = 0 ; i< 10 ; i++ ){ var temp = {}; var k = i; temp.test = function (){ return k; } a.push(temp); } for (i = 0 ; i<10 ;i++ ){ console.log(a[i].test()); } Output 999999999 var a =...

0
Q: How should I configure express server to handle websocket traffic?

Eugene ChoiI'm trying to build an internal chat application for one of my projects. I am planning to use a difference, dedicated instance of express server to handle the traffic for the chat, as opposed to using the main server to do everything. What would be the most efficient way to configure the serve...

 
11:06 AM
0
Q: mongodb 32bit mmap() failed with multidatabases

user3831830I have a virtual machine where i am running my node.js app with mongo databases. I know the 32Bit issue but i do not know, why this already happens on my system. If i am running my testcases i create a db for each testsuite -> after a suite has finished i drop all collections, indexes, call db.d...

 
11:30 AM
0
Q: Node Red http get request can't handle Hebrew content

MukyWhen using get Request, there are question mark instead of hebrew: Bellow is a snippet of the code invoking during the request: var req = ((/^https/.test(url))?https:http).request(opts,function(res) { res.setEncoding('utf8'); msg.statusCode = res.statusCode; ...

 
11:43 AM
0
Q: posting json to express - invalid json

wazzadayI am trying to post some json to a node server running express but it keeps telling me the json was invalid. But its not, its just a plain old object. Currently I get the error 'unexpected token i' client: $.ajax({ contentType: 'application/json', type: "POST", url: "/admin", da...

0
Q: Browserify the node.js http server

user3836329We created a simple js file, intending to find out if http.createServer works on client browser or not: var http = require("http") var server = http.createServer() server.listen(9024, function () { console.log("demo server listening on port 9024") }) and embedded it into a html after brows...

 
12:01 PM
0
Q: Highchart.js graphs not being displayed (Node.js)

kevin.desaiI'm trying to make a real-time dashboard using node.js, socket.io and highcharts.js. I have highcharts running on the client side, and as and when socket.io receives updates, the charts should change. here is my client side code, <html> <head> <title> Admin Events Page </title> <script type="t...

0
Q: My socket.io app's server is not starting on Heroku

user3836784I'm trying to deploy my app on Heroku. I've followed these instructions: https://devcenter.heroku.com/articles/getting-started-with-nodejs, but when I run $heroku open, the I land on the error page. Here are the logs I get from heroku: 2014-07-14T11:41:27.331343+00:00 heroku[web.1]: Starting ...

 
12:32 PM
0
Q: Looking for a message queue as a service with sequential processing support

user606521 It has to have node.js client lib. It has to allow processing some type of jobs sequentially (FIFO + only one job of given type can be executed at any time) As a Service Preferably with web interface I checked: RabbitMQ - does not support sequential processing IronMQ - as far as I know it al...

 
12:44 PM
0
Q: NodeJS - Grunt - Is it possible to run a Grunt task in NodeJs runtime?

Angelo GiuffrediI have a small application in express.js and i want to run a Grunt task, named "build", at the client request for now but i don't know how to pass sub-task configuration to Grunt module. executeTask : function (components) { // Other stuff this.grunt = require("grunt"); components = ...

 
12:55 PM
0
Q: Adding additional attributes to mongoose object

BabarI have been pulling my hair out on this one. I have a mongoose model which I want the user in current session to be able to like. I am successfully able to store the data in the session, what I want to do is to be able to push an attribute called like in the object returned from the database... I...

-1
Q: Sorting json by integer field nodejs

greWIve that JSON { title: 'title', ..., order: 0 }, { ..., order: 9 }, { ..., order: 2 } the json includes many fields, how can I sort them based on the order field ? I was looking for something builtin nodejs but I couldn't find anything that might be useful for that ...

0
Q: node.js - how can i get ip address of the remote domain

k.djonuaHow I can receive the IP address of any domain? For example - address google.com ip (without call of the utility of nslookup). Whether there is a ready module for this purpose?

0
Q: How can I require MongoDB within CasperJS?

azcn2503I am trying to insert records to a MongoDB collection from within CasperJS, but at the first hurdle I am blocked. I first installed mongodb by running the following command in the root of my application: npm install mongodb This completes successfully without any errors. I have a CasperJS fi...

 
1:12 PM
0
Q: Can't get mongoose.js to expire old documents at the right time

MortenHRAccording to http://mongoosejs.com/docs/api.html#schema_date_SchemaDate-expires I can expire old documents by adding an 'expires' attribute to a mongoose schema. The documents do get removed, when I use the code below, but after around 4 minutes instead of 10 (I've also tried with much higher num...

0
Q: Prevent crashes in a Backbone.js app with unexpected data in model

RayjaxI built a huge backbone.js app which works this way : As you can see, there is a Data backbone.js model, which values are accessed by getters in Getters.js and the values are used in Underscore templates to define some inline styling. The contents in the page are present in another Backbone mo...

 
1:28 PM
0
Q: use mongodb inside express

user2418508Hye everyone, I'm having a question regarding using mongodb inside express. My program uses socket.io. The clients firstly send emit a message contains the name of product, and then the server io would query the mongodb based on the message. Here's what I have now. I'm kinda stuck here as I'm not...

0
Q: callback function as a module.export parameter

BlakeCan anyone explain what does the callback() function do in the code below? and where does this callback function come from? var _ = require('lodash'); var i18n = require('./lib/i18n'); var options = { stage: 'options:post:configuration' }; /** * postprocess * @param {Object} params * @...

0
Q: Best way to change the layout of a mongo database

benharrisI have a large 9000 document mongoDB database and I need to loop through each document and modify it's tree/layout (This also includes deleting un-needed data) What would be the best way of doing this within Javascript? I am using mongoose, and have made a new schema, I also have the old schema...

 
1:40 PM
0
Q: Difficulty with absolute and relative paths in Express

turtleI have a route for an API in an Express app that looks like this: app.get('/:username/:bookmark/', function(req, res) { // do stuff }) As expected, this route resolves to: GET /username/bookmark/ However, I would like to use relative URLs for my static resources. For example, I would li...

 
1:52 PM
0
Q: Updating Highcharts realtime using Socket.io

kevin.desaiI'm making a dashboard using node.js, socket.io and highcharts. I want my chart to update dynamically on receiving a request from socket.io. How do I do that? Here is my client side code, <script> var socket=io(); var sales=0; var e1tcount=0; var e1scount=0; var e2tcount=0; var e2scount=0; ...

 
2:04 PM
0
Q: Route not being entered/hit

DrogoNevetsI have the following server.js var express = require('express'); var app = express(); var port = 8080; app.get('js/', function (req, res) { var uid = req.params.uid, file = req.originalUrl.substring(1) ? req.originalUrl.substring(1) : 'index.html'; console.log("RULE: 'js/'"); ...

1
Q: How can I get the current datetime in the format "2014-04-01:08:00:00" in Node?

anandI need the current system datetime in the format "yyyy-mm-dd:hh:mm:ss". http://stackoverflow.com/a/19079030/2663388 helped a lot. new Date().toJSON() is showing "2014-07-14T13:41:23.521Z" Can someone help me to extract "yyyy-mm-dd:hh:mm:ss" from "2014-07-14T13:41:23.521Z"?

0
Q: Regexp emoticons replacing fails with urls in string

SydHello I'm creating a website in which I have a chat the user input is filtered for html entities and the only thing that is not escaped is links to images and website urls. Furthermore I have added some emoticons that are also being filtered out after the initial html encoding and this is the iss...

0
Q: Node.js - Can I install NPM package on a PhoneGap / Cordova application?

user3837226I'm building a mobile app thanks to Cordova, and as Cordova is based on Node.js, I thought that I could use NPM packages into the app. For example, I want my mobile app to talk to a remote MySQL database. I thought I could use the mysql NPM package (https://www.npmjs.org/package/mysql) in order ...

0
Q: notepad++ with node using sockets error

Dennington-bearIm trying to send a message from a webpage to a node server. Im using notepad++. My html looks likes this: var socket = io.connect('http://192.168.201.91:8001'); socket.emit('Stream', {"StreamName": "Livestream5"}); These are supposed to connect to a node server which is on the given address. ...

 
2:49 PM
0
Q: piping data through Q promises chain

sumekI'm chaining Q promises: Q(initialCall).then(someOtherCallThatUsesResultsFromPreviousResults) A call usually means a promisified node.js http.get call to an external REST api. The path is constructed using information from previous call. At the same time I want to pipe the information from pre...

0
Q: How to use NGINX with subfolder

JoshOneI have setup NGINX and I'd like to host both Wordpress and Node instances on the same server. I have it working, but I want to make sure that my config is right. Here is the config for a node instance that I would like to show up when the user goes to the subfolder listed. #HTTP Server server...

0
Q: What is the best way to listen to json url array changes?

user2466914This one seems to be like a general question, hope you can help me. I have a PHP server, and a url source with json array, I need to "listen" to this url, and trigger a php function as soon as the json array is changed. I thought using node.js, do you think its a good idea? any other suggestion...

 
3:07 PM
-1
Q: Sort number in node.js (JS)

Or SmithI have a list of files: 10110_src 2351_src 1023_src 50102_src I want to sort the files according to the digits of the beginning of the file name. So the sorted list would be: 1023_src 2351_src 10110_src 50102_src I find only sorting of string according to alphabetic order. there is any way ...

-2
Q: How to find outlook express inbox repair tool?

user3790826What happen? My OE folders are empty. Can any Outlook Express inbox repair tool helps me?

0
Q: What does the --save-dev option mean in npm install?

dscy-prsmI saw this here npm install grunt-bower-task --save-dev What does --save-dev do? Is this the same as doing without it?

-1
Q: Matching input - promo code system - nodejs express framework

SteveI’m fairly new to developing with nodejs and express, so far I am enjoying it. I'm developing using parse.com and the express framework. My web application requires a promo code to be redeemed before the user can sign up. I have created the promo codes in a collection and I require some help to ...

0
Q: does expressjs cache the routes? If so how to remove them in development

cooolIf there is a change in a module I am deleting the module using require.cache and requiring the module again. it works...but in case of routes in expressjs it would not overwrite the existing routes..new routes are added..infact it would not even delete the deleted routes(i n that module)..how to...

0
Q: How to reduce memory usages on larg objects logging in winston daily file rotate transport?

VivekBajpaiI have configured winston to log in two different files with a custom log.js file to rotate logs on hourly basis across different module. Log.js var winston = require('winston'); // setup winston for request log winston.loggers.add('request', { transports: [ // Setup your shared trans...

0
Q: oauth2 with mongoose implementation login / user collection

gdubsI've been trying to figure out what would be the best way to architect my log in or user collection. I have searched for awhile and I would mostly see a way where after the URL passport.use('provider', new OAuth2Strategy({ authorizationURL: authorizationURL, tokenURL: tokenUrl,...

 
3:41 PM
0
Q: recommendations for starting d-quill project

RoostertailI want to use d-quill in a derby/node collaborative web app. I am VERY new to Node an Derby and have poured over their docs and examples. However, I cannot get d-quill to render on the webpage, never-the-less the text project onto another browser. I am just lost on even where to start. Can I ...

 
3:53 PM
0
Q: Parse node.js express app, form enctype="multipart/form-data" destroys request body?

Ivan Ristici am building an app backend with parse, and i need to do some image uploading, but when i post to the app url with the form enctype being multipart/form-data, the body is empty? This is the method which recieves the post: // These two lines are required to initialize Express in Cloud Code. var...

 
4:11 PM
0
Q: Posting Firebases's thirdpartyuserdata object to the server

n4cer500I'm using Firebase and the SimpleLogin to allow users to login via Google, Twitter etc. I'd like to use some of the thirdpartyuserdata object to create a user profile for my application which runs on Node. Currently I'm posting this data to the server so that I can add to it and create the prof...

0
Q: Internationalization with Handlebars

rink.attendant.6I'm trying to internationalize my application that uses Express and Handlebars. Is it possible to get Handlebars partials (fragments) to load and render the localization resource file? Noting that I've already read this question: express3-handlebars and 18next-node - internationalisation based o...

 
4:29 PM
0
Q: Microsoft Visual Studio:Wont Send Emails to my Gmail

user3837647okay i just started do this type of stuff and i ran into this.Anyways i was tryng to get this to connect to my gmail account but it wouldnt send it at all. any help would be appreciated. what i really am asking right now is if u can tell me why this is send me the email or if i cant the way i hav...

0
Q: mongoose model.save error crashes the node.js server

user3785337my Node.js server is crashing while saving collection using model.save. My schema has a unique field how to handle error my code is register.save(function(err) { if (err){ console.log(err); res.send(err); } res.json({ status:'Su...

0
Q: Save cookie in node.js and send in client requests

The18thWarriorI'm using the standard https module to login to a 3rd party server and perform subsequent request to it. The server returns a session cookie that is to be used in all other requests. I am able to retrieve the cookie, but I when I attempt to set it in my request, the server does not recognize that...

1
Q: Setting post title for URL vs display in poet

user645715Using Poet (https://github.com/jsantell/poet) in Node + Express + EJS, and all is working well. Except for one thing .. how do I specify the title for the URL vs for screen display? Right now, I have the following directory: ./_posts/ hello.md colors.md shapes.md ... The cont...

0
Q: Node JS HTTP GET request body

synoI am using the express module in node.js and I am trying to read the body of an HTTP GET request and send an answer back to the user based on the content of the body. I am new to node.js and this is not working for me. I know I should be using HTTP POST for this (and it works when I am using pos...

0
Q: Heroku Sails Application accessing mongodb located on mongohq

user3837739Our application(node js using sails framework) is trying to access mongodb which is located on MongoHQ. When application is run from local system it is working fine. But once application is installed then values are not saving mongodb on mongohq rather its is saving somewhere in heruko. Configura...

0
Q: Reading JSON file and template data using Express handlebars into html in node.js?

user3669481My ultimate goal is to get a JSON file and apply template to format the data into presentable html files through node.js express. I was reading and following this example of how to use handlebars to template JSON file: http://www.tutorialsavvy.com/2013/10/using-handlebar-template-for-json.html ...

 
5:03 PM
0
Q: Error when running azure-cli commands

Sean LynchToday when I tried to create a deployment script using the azure nodejs sdk azure site deploymentscript –-node I got the following error: Mon Jul 14 2014 12:53:16 GMT-0400 (EDT): [TypeError: Object #<Object> has no method 'imageDelete'] TypeError: Object #<Object> has no method 'imageDel...

0
Q: phonegap npm install error

user3820407I was installing phone gap. In phone gap website its shows the commands and instructions. I installed nodejs and executed the commands. But resulted in error. I tried Node.js NPM error when installing PhoneGap on Windows 8 Can u give a step by step instruction ? I have downloaded phonegap.zip ...

0
Q: Node.js : Ajax call from inside an HTTP request

xShiraseI'm trying to make an Ajax call from inside an http request. Here's my most hopeful attempt : jsdom.env({ url:"http://example.com/yyy.aspx", headers: { 'Origin': "http://example.com", 'Referer':"http://example.com/yyy.aspx", 'Connection': 'keep...

 
5:38 PM
0
Q: Write a function that will return the 5th from the tail (i.e. the end of the list)

Lucy JonesA linked list data structure contains a collection of objects, where each object contains a reference to the next object in the list. Write a function that will return the 5th from the tail (i.e. the end of the list). Explain how you would test your solution. Assume that the linked list clas...

1
Q: npm Use 2 Versions of Python

trysisWhenever I install certain node packages, there are errors involving the Python version. This is because I have both Python 2.7 and Python 3.3 (those were the latest versions last time I updated, but now there is 3.4), but obviously I can only source one version in my PATH (any later folders are ...

 
6:02 PM
0
Q: How to get a document field value in MongoDB through Node.js?

RonI need to access a MongoDB document's field value through Node.js (the regular driver). How can I do this without getting into callbacks? (Basically, I just want to get the field for doing some calculations.)

0
Q: Error while building geo index using mongodb and nodejs

user3791927I'm trying to build a geo index db.collection('servicereg').aggregate([ { $geoNear : { near : [ -121.9181731, 37.4544319 ], distanceField : "dist", maxDistance : 500000, // query: { "servdescription": { $regex: "need" } }, // includeLocs: "dist.locat...

0
Q: Grunt 'grunt-contrib-coffee' not compiling Not sure if files are being found or if it's just not compiling.

dmanI have this directory structure: one@node ~/github/ucp/ucp/app/scripts/services $ lr total 12K drwxrwxr-x 2 one one 4.0K Jul 14 17:46 . drwxrwxr-x 4 one one 4.0K Jul 14 17:46 .. -rw-rw-r-- 1 one one 506 Jul 14 17:46 enviroment.coffee In my Gruntfile.js I have: coffee: { compile: ...

 
6:32 PM
0
Q: Loading mongoose models with istanbul

Michael KunzmannI want to implement code coverage for our project, so we use grunt-istanbul. I'm sticking to this Tutorial: https://github.com/taichi/grunt-istanbul My problem is, that I get this error when running the tests against the instrumentalized source code, but it works fine when running the test again...

 
6:44 PM
0
Q: Parse.com - Static files vs Dynamic URLs order

LucasI'm trying to execute cloud code first, before looking for files in the /public directory on Parse.com Cloud code. Reading ExpressJS documentation, I've found that you can change the precedence using app.use(app.router); app.use(express.static(__dirname + '/public')); the problem is when I t...

0
Q: How to get ZombieJS+NodeJS to run over a collection?

DraconarMy naive approach to get ZombieJS to loop over an huge array of items was to add the following code inside my for loop var Browser = require("zombie"); var assert = require("assert"); // Load the page from localhost browser = new Browser() browser.visit("http://localhost:3000/", function () { ...

 
7:10 PM
0
Q: ajax calling javascript with parameters and get response, node-webkit

Ignacio BustosThis is kind of confusing. I need this because i am using node.js (node-webkit) in local, there is no php to wait for a response. Just javascript code and files. I want to do an ajax call with parameters (i did not think yet about get or post parameters) to a "url" of a javascript file. I do no...

0
Q: Received network data does not match the specified length

user3838086I am developing an HTTP parser for node.js (I cannot use its native HTTP library) and even though the implementation is still sort of basic, it generally work. However it appears there is a problem with certain response bodies (I assume it is encoding related) when the specified content length do...

0
Q: Socket.IO: Let User "Tail" app.log, only for their own initiated commands

aarosilI have an app which does bulk edits of 1000s of items through an API that is slow. I want to use Socket.IO to display to the users the status of their batch jobs as they are running in real time (one-way communication from server to browser) I just started using Socket.IO for the past 1-2 days,...

 
7:22 PM
0
Q: Difference in repository packages

Ed_I'm trying to install nodejs on a vagrant based vm (hashicorp/precise64 ubuntu). The command "apt-cache show nodejs " shows me the 0.6.12~dfsg1-1ubuntu1 version. The same command on the hosting machine (lunix mint 17) results in "Version: 0.10.25~dfsg2-2ubuntu1". Why is there a difference? How to...

 
7:43 PM
0
Q: Disable Sessions in Kraken or node

im_bentonHey everyone I need to remove Sessions in my Kraken.js project when NODE_ENV=production due to this: Warning: connect.session() MemoryStore is not designed for a production environment, as it will leak memory, and will not scale past a single process. Here is my Index.js file. 'use strict'; ...

0
Q: Looking for example, How to use Jade with Hapi framework

akj62I am looking for some sample code, examples and tutorial to understand, how can I use Jade with Hapi Framework. How I can send the data with a Jade form and a Hapi function. Thanks, Akshay

0
Q: How to make yield work with this.req.on('data')?

Jan Carlo VirayObviously, the reason here is because of the async nature of on('data'), but how can I make this work? I tried "thunkifying" _this.req.on, but to no avail. I'm still getting the hang of generators, yield and thunks but I'm a bit stumped here. var thunkify = require('thunkify'); var request = thu...

0
Q: How to do a query using dot( . ) through Mongoose in Node.js and How to add an empty array

debekaI have the following schema: var userSchema = new Schema({ userID: Number, userName: String, userEmail: String, teams:Array, socialMedias: { fbUID: String, googleUID: String, twitter: String } }); First, How can I add a...

0
Q: Best way to define a product schema with ratings

Marcel BatistaI wanted to check with you guys if this is the only/best solution for my mongoose schema definition. The problem is simple. My DB has a collection of Products and a collection of Ratings for these products, that hold basically a rate (typically 1 to 5), the user who rated and the time. I want t...

 
8:12 PM
0
Q: How to use backbone-relational along with backbone-deepmodel to backbone.extend?

Alek HurstI am working on a project that creates models in such a manner. Backbone.DeepModel.extend({ ... }); This deepmodel allows for deeply nested attributes to be refereed via sytax such as containerGrid.get('cols')[0]['content'] Now I have to implement nested models in a one-to-many format. D...

 
8:23 PM
0
Q: phonegap build problems (android)

Ewan ValentineWhen I try to build my app, using Linux ElementaryOS (Ubuntu 12.04 (I think?)) I get thousands of errors saying: rm: could not remove file (code EACCESS) The results of the following show: $ phonegap -v 3.5.0-0.20.4 $ cordova -v 3.5.0-0.2.4 $ ant -v Apache Ant(TM) version 1.8.2 compiled on ...

 
8:47 PM
0
Q: how client/server communication works with meteor/nodejs

juanp_1982I'm learning about Meteor. Right now I'm trying to figure out how the client/server communication works, I have a file under [root]/server with all the information to connect to DB (user, password, host, port) also I have the following line of code to test this "communication" var getUsers = fu...

0
Q: Uploading XML string from C# to node.js/express server

user3838455I'm trying to upload a string (which is XML but for the purposes of uploading I'm trying to treat it as a regular string) to an express.js server which will then process the XML and send back a short string as a reply. The XML is retrieved in a C# console app: public static void Main(string[] a...

1
Q: list all available sub generators in yeoman

facebooksay i run yo marionette i get a marionette app. then i want to list all available sub generators for this generator, like this Marionette marionette:app marionette:collection marionette:collectionview marionette:compositeview marionette:controller marionette:itemview marionette:lay...

0
Q: callback on net.createServer() is called twice

ZuzlxI'm following the tutorial on this tutorial. Here's the code: var net = require('net') var chatServer = net.createServer() chatServer.on('connection', function(client) { client.write('Hi!\n'); client.write('Bye!\n'); console.log("got msg from http"); //added client.end() }) chatServer.liste...

 
9:17 PM
0
Q: mongoose db returning data from two documents

Eric EthingtonI am creating my first mongoose database app. I am trying to write an express API call that returns an object that contains data from two documents. Whenever I call the /data route I get an empty array back. I added two console.log lines and the output is: test2 test1 What can I do to have ...

 
9:46 PM
0
Q: Node Convert Image URL to data:image using streams

fisch2I currently have an endpoint which is used to circumvent CORS that takes in any image URL and returns the contents in data-uri format. This works well, but I think it would be much more efficient to use a streaming solution where the response is built as a stream from the image request. Here is ...

0
Q: How to make ZombieJS wait indefinetly for a site

DraconarI'm using zombieJS to scrap a veeeeeeeery slow site. I tried many things to make it go slower, but I'm receiving lots of TypeError: Cannot use 'in' operator to search for 'compareDocumentPosition' in null errors. I tried to add to my pressButton function the following: browser.wait({wait...

0
Q: click all "see more"s of posts in fb

HoseinBLI have a page with lots of posts in FB. I want to copy all post's text in a txt file. what should I do ? is there any shortcut way ? I scroll down untill all posts loaded and press ctrl + a and ctrl + c then paste in txt file, but some posts not copied completely, they copied till "See More". ho...

0
Q: Breezejs SaveChanges: custom nodejs SaveResult

ppolianiIs there an example showing the structure of the SaveResult object. I'm working with nodeJS and Mongoose on the back-end; thus I would like to manually construct that object and return it back to breezeJS.

0
Q: Is MongoDB is good for handling SQL-type data?

f1nnI have a rather huge application storing data in MongoDB (Mongoose) despite the fact my data is absolutely sequel and can be presented as tables with schemas very well. The specific is I have a lot of relations between objects. So I need to perform very deep populations — 25+ for each request in ...

0
Q: expressjs node rest client

OsguxI am trying to get data from this method GET // registering remote methods client.registerMethod("jsonGetInfAboutUserByEmail", url_server+"/api/v1/users/?app_name="+app_name+"&app_key="+api_key+"& email=marti1125@gmail.com", "GET"); client.methods.jsonGetInfAboutUserByEmail(function(d...

0
Q: Can NodeJS be used on the web instead of the command-line

Jacques MaraisWhen developing a website and doing some server-side stuff with NodeJS can NodeJS be used on the command-line only or can it be used for scripting too? For example creating a script and doing all my NodeJS stuff in there and then including the script in my HTML without the command-line or is this...

 
10:38 PM
1
Q: RabbitMQ messages disappearing mysteriously

Wandering DigitalI have a node worker waiting for RabbitMQ messages. Today I made some changes to it, and now when I connect the dev instance, everything works—it appears to connect—but then the consume functions don't fire. Messages still disappear though like they've been consumed. Rabbit.queue('consume', func...

0
Q: Update And Return Document In Mongodb

user3803096I want to get updated documents. This is my original code and it succesfully updates but doesnt return the document. collection.update({ "code": req.body.code },{$set: req.body.updatedFields}, function(err, results) { res.send({error: err, affected: results}); ...

 
11:08 PM
0
Q: Reading, writing and storing JSON with Node on Heroku

Jack WildI am building an App based on Node.js running on Heroku. The app uses a JSON file which at the moment is being pushed with the rest of the app, and we are reading and writing to it like so: var channelsList = require("./JSON/channels.json"); ... fs.writeFile("JSON/channels.json", JSON.stringi...

0
Q: How to use "And" in a Gherkin using cucumber.js

JackieI am trying to use Cucumber.JS to do my automated testing. If I do the following... var sharedSteps = module.exports = function(){ this.World = require("../support/world.js").World; this.When(/^I click on the cart$/, function(next) { this.client.click("#cartLink", function(err, res...

 
11:49 PM
-2
Q: NodeJS - mkdir possible?

TombaI would like to know if its somehow possible to create folders on a local server with a node js application and than upload some stuff. Or if thats impossible. If its not possible directly with node, is there another method how I could solve this problem ?

0
Q: AngularJS controller not connecting to view

user3311351My view is not linking up correctly with my controller... i believe at least. This is due to the fact that when I submit a form in the particular view > it is passed in as a URL param, an obvious red flag when I am trying to make a POST request. Where am I going wrong? Please review the below co...

 

« first day (58 days earlier)      last day (19 days later) »