« first day (53 days earlier)      last day (24 days later) » 

1:06 AM
0
Q: Retrieve the self-generated _id value of the object after pushing it to a existing collection

HHHI have a mongodb document, let's say having the schema class: String, class_teacher: String, students: [ { student: String, marks: number } ] In the above example if I push a new student to the collection, it'll generate a _id for each student and I am doing it by using ...

0
Q: Can't log error data using winston for express app

Haseeb Javedwinston and winston-mongodb set up to record logs for my express app. The problem is that it is only recording logs for the endpoint that i have at my root directory such as localhost:3000/apidocs or localhost:3000/index but I have an entire REST app at localhost:3000/api/v1/customers and it is n...

 
1:22 AM
0
Q: How do I connect Modulus database to my local app in place of local mongo database?

reknirtI have a basic node/express/mongo api app running locally. Currently I have mongoose POSTing and GETing from a local mongo database in server.js like so: mongoose.connect('mongodb://localhost:27017/myapp'); But I want it to store data in my modulus app, which is located here: mongodb://<user>:<...

 
2:10 AM
0
Q: Import RSS feed to MongoDB

John VerroneI have a MEAN application that works as intended, Angular can pull data from my MongoDB, Express handles the API, etc. I want to import data from an RSS feed into my database as it gets imported into the RSS feed. I originally had my app pull the JSON from the RSS feed when the page is loaded, b...

0
Q: aggregated.css is not updated when a css file is modified (mean.io module)

tivoniI've created a mean.io module within a new project. All the good stuff is there: grunt (+plugins, sass among them). grunt-sass is auto-generating a css file under packages/myModule/public/assets/css/mystyle.css To include it in the aggregated css, in app.js I added myModule.aggregateAsset('c...

0
Q: Using Callbacks

BenI'm trying to use a callback to get the result of a query from a database, but I am still getting undefined returned to me. Here is the code: function onComplete(x){ return x; } function getRecords(callBack){ mongo.MongoClient.connect("mongodb://localhost:27017/nettuts", function(err, d...

 
2:29 AM
0
Q: number of addresses in JSON?

ConfusedDeerI have the following JSON (which I validated and verified is correct) and I'm trying to get the number of addresses. When I do a var location = req.body; I get { AddressValidateRequest: { '-USERID': 'xxxxxxxxxxx', Address: [ [Object], [Object], [Object] ] } } How do I get the n...

 
2:42 AM
0
Q: Accessing remote node express server

cadlacI set up an express application on digital ocean, and would like to develop the application remotely from various machines. I'd like to be able to ssh in, test files, then visit "http://:" and view the files. However, whenever I visit the root path, the express server is returning a 404 and tel...

 
3:24 AM
0
Q: Node.js SOAP client parameter formatting

user2990220I'm having trouble properly formatting one particular soap parameter using the node-soap module for node.js as a client, to a 3rd-party SOAP service. The client.describe() for this method says this particular input should be in the shape of: params: { 'param[]': {} } I have tried a bunch of d...

0
Q: Why Do I Get "Unhandled exception: Not a string or buffer Type"?

jamie_yThe error originates from the line below, which does not make sense because I'm following the example correctly (https://www.npmjs.org/package/aws-sign). Any hint is appreciated. var signer = new AwsSign({ accessKeyId: 'AKIAIO7EXAMPLE', secretAccessKey: 'bPxRfiCYEXAMPLEKEY', }); ...

 
3:53 AM
0
Q: What is the smartest way to git my node.js project that depends on my other projects? GitHub

Ken OKABEI have a node.js project that depends on my other node.js projects. NodeProject1 (depends on) NodeProject2 NodeProject3 This NodeProject1 is also node_module library, and will be used in another NodeProject4 as the dependency. This NodeProject1 is under the heavy development, so...

0
Q: Mongodb agregation on computed sub documents

P.MI am working on photo sharing application that has a mongodb model that looks a bit like: Location = { _id : id, address : address, name : name } Photo = { _id: id, _upvotes : [{ ref to User }], _location : {ref to Location}, url: url, ...

0
Q: Node Js Debug - Failed to launch browser - 1337 port not monitored

mind1nI've installed the latest NodeJs and NodeJs tools for Vs2013. (Both Visual Studio 2013 and Node Js were run in Administrative Mode) I created a simple Node Js Web project in vs 2013. The code is given below: var http = require('http'); var port = process.env.port || 1337; http.createServer(fun...

 
5:01 AM
1
Q: Bootstrapping web application - PHP, Ruby, Python, Node.js

MakitaAssumption 1: When running PHP via apache or nginx, each incoming request results in the script bootstrapping all of its include files, so essentially there is no shared memory, and the "world is recreated" upon each request. Assumption 2: Node.js applications are bootstrapped when the server is...

0
Q: Node.js|Worker Processes: How to verify two-way communication between a master and worker process

MillerI have this example script from node describing how to send messages from either a Master or worker process using cluster. When I run this script, I am unable to verify the message from either the Master or worker. It appears the worker.on statement is not executing. Can anyone explain how I c...

 
5:35 AM
0
Q: Convert custom_filters_score query to newest function_score with ElasticSearch

Teh SoToIn order to update a query created with an old version of ES (previous to v0.94) i am presented with a query called like this: json.query.bool.should = [ { "custom_filters_score" : { "query": { "m...

 
6:05 AM
0
Q: Dynamic page titles on AngularJS app

hercWe are building a big AngularJS/NodeJS app and we came across a problem. It has to do with the page titles. On our app, we want to have dynamic pages titles for each state (we are using ui-router). I know that we can add custom fields to any state (like pageTitle): .state('app.home', { url: ...

 
6:21 AM
0
Q: Specifying a start script - Node

SanchitThe Node JS application is working fine using node command. (node app.js) I haven't as yet used the start / test scripts in package.json file (As a bonus: If you define scripts.start in your package.json file, you don't need a Procfile) like: { "name": "application-name", "version": "0.1.0",...

0
Q: How to move from meanjs prototype to production

Toni RistolaWhat needs to be done to put meanjs prototype for production ready? I have done few prototypes with meanjs http://meanjs.org/ and was considering doing an actual implementation with it to production. Few things to consider: Scalability - I think nodejs is using single threaded http server, that...

 
6:42 AM
0
Q: how to add custom js file in insight-api of Bitcoin?

code ghostI have a custom API for creating public and private key .I want to add this API to insight-API.can anybody help me ?

 
6:59 AM
1
Q: Is socket.write thread" safe?

Somesh MukherjeeI am using node.js to communicate over a socket in json. One of the operations sends a big file over the socket in base64 format. As a result the message is split into packets and triggers various data events on the client. I handle this using a buffer on the client side var response={ file:...

0
Q: Compare node.js passport authentication password with c#

user3819192I am using Passport Authentication. in my node.js application and it is working fine. But now i am creating a web forms application using c# where user can login with same username and password but i am not able to encrypt and compare the same password in c# application.Please help me to solve th...

0
Q: Read/write binary data to MongoDB in Node.js

BiosopherI've been able to successfully write binary data (an image) to MongoDB in Node.js. However I can't find clear documentation on how to read it back. Here's how I'm writing the image to MongoDB: var imageFile = req.files.myFile; var imageData = fs.readFileSync(imageFile.path); var imageBson = {...

 
7:37 AM
0
Q: parsing phone numbers in Node JS using libphonenumber

mandeep_m91I need to parse all the phone numbers extracted from my phonebook to lets say a flat file The input will be a list of phone number strings which can be of the form (considering my location is India) +91-99XXXXXXXX 98XXXXXXXX 098XXXXXXXX 011-25XXXXXX // This is a Delhi local number 0044-79XX...

0
Q: Grunt: Run 1 plugin within 2 tasks with different destination settings

headacheCoderI'm using the grunt-contrib-compress plugin in Grunt to zip the contents of a folders content and move the ZIP file into another folder outside my production directory. Here is my current Gruntfile: 'use strict'; module.exports = function(grunt) { function createTimeStamp(path) { return...

 
8:20 AM
0
Q: Query data from mongoose and display it on a html page

user3789868This is my schema var productSchema = new mongoose.Schema({ name: String, description: String }); var Product = mongoose.model('Product', productSchema); In my index.js i am using exports.welcome = function(req,res) { Product.find({},{},function(err,docs) { res.render('wel...

0
Q: Mongodb findAndModify node js

Rakesh GoyalFollowing code gives me exception in node js saying: "need remove or update" var args = { query: { _id: _id }, update: { $set: data}, new: true, remove:false }; db.collection(COLLECTION.INVENTORY_LOCATION).f...

 
8:43 AM
0
Q: Child process variable doesn't die with process?

Jacob PedersenI am spawning a process using child_process's .spawn like this: prc = spawn('java', ['-jar', '-Xmx512M', 'jarfile.jar']); Which works just fine, however when the process ends, the prc variable is still alive with all the data, for example: # console.log(prc.pid); # 32407 But if I try to ch...

 
8:56 AM
0
Q: PhoneGap - get started in Visual Studio 2012

Mark FalexI have complete project in Visual Studio and I want it wrap to PhoneGap. I can't install PhoneGap, when I am writing to command line this: npm install -g phonegap, so I get this: npm ERR! not found: git npm ERR! npm ERR! Failed using git. npm ERR! This is most likely not a problem with npm itsel...

0
Q: Authentication with passport. Can I trust that req.user is indeed the logged in user?

mart0903I'm using passport to authenticate users at my site. Users can register orders, which have and foreignKey (ObjectId) to the User object. Example-objects (written as mongoose schemas): var orderSchema = new mongoose.Schema({ ... address: String, _userID: {type: mongoose.Schema.Types....

0
Q: Mongoose population nested data models

Abhishek DeHere's my entire Mongo Schema using Mongoose. var questionschema=new mongo.Schema({ category: String, body: String, option1: String, option2: String, option3: String, option4: String, year: Number }); var Question = mongo.model('Question',questionschema); var papers...

 
9:14 AM
0
Q: npm install fibers shows error

user3615680When i try to install fibers using npm install fibers i've got following error, Also i tried with other solutions in the stack overflow but none of them is helped, please help Iam using OSX 10.8.5 > fibers@1.0.1 install /usr/local/lib/node_modules/fibers > node ./build.js gyp ERR! build error...

 
9:25 AM
0
Q: Xml parsing problems using xml2js

kevin.desaiI need to parse huge XML data and insert the values in a mySQL table. My XML data is in this form, <BMS version="1.0"> <Summaries> <Summary Booking_strId="CWBL00D7CB8J8U" Booking_lngId="466244159" Trans_lngId="466244159" App_strCode="WEBIN" Event_strType="CT" Trans_dtmBookingStamp="Mon, 30 Jun...

 
9:49 AM
0
Q: How to select in Jade

user3801085Today I build a website for a school with express. This is a part of my template: center b u Etudiants br br table thead tr: th First Name th Last Name th Classroom Name th Actions tbody each item, i in stud tr: td #{it...

 
10:01 AM
0
Q: SailsJs res.render vs res.view

haotc92I'm trying to use SailsJs to make a simple authentication web app with PassportJs + EJS template engine. This is my code in the AuthenController.coffee processSignin: (req, res) -> passport.authenticate('local', (err, user, info) -> if err or not user return res.view('auth/signin',...

0
Q: Send callback functions through IPC from forked child_process in nodejs

MasiarI'm using child_process to fork some work on a system. I have to send some data from the child to the "father" and I'm doing it like this: process.send({ message: "some_stuff", some : stuff, cb: cb }); Where cb is a defined callback. On the other side ("father"'s side), inspecting ...

0
Q: Mongodb storing a previous day ie a day - 1

TrialcoderI am trying to save a specific format date in mongodb, but its saving a day-1 Example - db.test.insert({name: "test1", dob: new Date(1986, 11, 30)}) But it is saving the date as 29 December 1986, let me know what I am doing wrong. Also I tried the same at http://try.mongodb.org/ but thr too it...

0
Q: How to includes support for using the svg with jsdom node package

Amol M KulkarniConsider the below content: <?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml-stylesheet href="" type="text/css"?> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg> <g id='test'> <polygon points="942.028,-1134.35 787....

0
Q: VS2014 MDHA Project not loading

vishaldwdiInstalled VS2014 Update2 Installed CTP1.1 Trying to create blankcordovaapp project. this error is appearing. any solution? Z:\VSProject\Projects\SampleHybridApp\SampleHybridApp\SampleHybridApp.jsproj : error : The imported project "C:\Users\Vishal Dwivedi\AppData\Roaming\npm\node_modules\vs-mda...

0
Q: Scalability, concurrency and response time in node.js serving API: better than Sinatra/Scala/Go?

josalWe're building a location-based app that has to provide realtime information about the location of things nearby. We're using Phonegap to build a hybrid client that can serve the information via a central backend API. This API is currently being implemented in Node and mongodb. Regarding the DB,...

-1
Q: how node js blog platform ghost store content?

jabez128Does it use some database system or does it just store content as plain text? If it use a database system, how it install it when it initializes?

0
Q: send params to node server using cordova

Houssem2101I'm trying to upload file and send params in the same request it's possible with filetransfer but i have a problem in the server side the req.body is always empty i'm using formidable module this is the client side upload = function (imageURI) { var ft = new FileTransfer(), ...

 
11:10 AM
0
Q: Error: Cannot find module './grunt/config' when building on TravisCI

FendaTravisCI is throwing an error when trying to run tests for my application. However, it works fine on my local. Until recently the node_modules folder was in the .gitignore so wasn't in the repository. Therefore TravisCI ran npm install to install all the modules. But since I've committed node_mod...

0
Q: NodeJS and MongoDB send response when finish all

colymorei need to do some MongoDB queries for return a result for a request. This is my code: var getFzAmount = function (req, res, next) { var id = req.params.id; var total = 0; var error = function (err) { next(err); log.error(...

0
Q: Rendering an image from node.js within Express() (Azure Mobile Services)

Sébastien PertusI try to render an image with Express from Azure Mobile Services. I get the image from a SQL Database, no big deal. But when i try to render my image, it doesn't work as expected. here is my code : exports.getImage = function (request, response) { console.log('Getting image param : ' + reques...

0
Q: How to get a variable from a Nexpect method?

esdrasportilloI am running Nexpect from inside a Docker and I need to get the IP of another docker container, so I ssh into the host and I run a method using Nexpect to get the IP address, but I don't know why the method is returning null, here is the code of the method: exports.getIP = function(username){ ...

0
Q: Real time web app - Which language/framework?

franki'm starting to develop a web application for which I need real-time capability. In particular, as result of a server-side event (without client request), the client must refresh the view. The best solution seems to be a websocket communication. My doubt is mainly between Node.js and JavaEE 7. W...

 
11:42 AM
0
Q: npm install is missing modules

Jeanluca ScaljeriBefore I can run gulp in my project I need to run npm install. This works except on my computer, because I get the following error: Error: Cannot find module 'socket.io' at Function.Module._resolveFilename (module.js:338:15) at Function.Module._load (module.js:280:25) at Module.requi...

 
11:53 AM
0
Q: downloading files from nodejs using angular at client side

deadmanI have a simple angular app which has configuration like - angular.module('app',['ngResource','ngRoute','ui.bootstrap','angularFileUpload']); angular.module('app').config(function($routeProvider,$locationProvider){ $locationProvider.html5Mode(true); $routeProvider .when...

0
Q: send private details to each socket with socket.io

monur00006I've 2 players in a multiplayer quiz. Each client has true answers and false answers. True answers : socket.true False answers : socket.false I'm increasing each variables answer by answer and finally, after 5 answers, i'm calling finishgame function. I wanna send a data that contains count...

0
Q: Node.JS: Express Application Returning 502 Bad Gateway on CSS/JS due to lack of trailing slash

jcpedenI'm running Apache to serve up Wordpress and want to run Express on the same server. I've been able to redirect all requests to a particular domain through to port 3000 and server up my Node.JS app accordingly. I'm running into trouble with js and css files though as they return a 502 error al...

 
12:29 PM
5
Q: How to install mongodb in Elastic Beanstalk?

Kaushick GopeI'm trying to setup an Elastic Beanstalk with mongodb. I get a solution in this link. But it is not working for me. I'm using " 64bit Amazon Linux 2014.03 v1.0.4.". When I'm trying to install mongodb using the solution of the link, it stops the instance with the following error. Error: failed to...

 
12:47 PM
0
Q: Node.js setTimeout() behaviour

dsljanusI want a piece of code to repeat 100 times with 1 sec of delay in between. This is my code: for(var i = 0; i < 100; i++){ setTimeout(function(){ //do stuff },1000); While this seems correct to me it is not. Instead of running "do stuff" 100 times and waiting 1 sec in between what it does...

0
Q: TravisCI fails with Cannot start PhantomJS

FendaTravisCI seems to be unable to start PhantomJS to run my Karma/Jasmine tests. Here is the error log: INFO [karma]: Karma v0.12.16 server started at http://localhost:9876/ INFO [launcher]: Starting browser PhantomJS WARN [watcher]: Pattern "/home/travis/build/fender/dmeapp/config.js" does not ma...

 
1:05 PM
0
Q: Return object from REST call

HamishI'm pretty new at node, so I may be going about this all wrong (if I am, don't be afraid to say) - I'd like to be able to create an object made of data from several different rest servers and return the final object to my calling function. For each rest api I have a function that looks a bit like...

0
Q: Express/AngularJs "angular is not defined"

CalebI am following the lessons on egghead.io trying to learn Angular. This lesson is about $http, and for some reason I can’t get a basic Expressjs/Angular app running. Lesson link: https://egghead.io/lessons/angularjs-http To run the app I am using the command node app.js. This is the error I am ...

 
1:42 PM
0
Q: Upgrading an existing cordova cli project from 3.3.1 to 3.5

brahmanaI have a cordova cli project created with cordova 3.3.1. I want to upgrade to 3.5 as it includes a bunch of fixes/feature implementations that are going to be very useful to me. Can I just go ahead and update the cordova npm package and update platforms (iOS and Android) as described here : http...

 
1:56 PM
0
Q: node.js request fails for umts Stick Webserver (huawei)

solicki´m trying to get websites / xml objects from the huawei umts stick internal web gui. I´ve written a wrapper in c using libcurl which works fine. Now i want to port this to node using request. When i call a url with curl from console like this: curl -G "http://192.168.1.1/api/monitoring/status...

 
2:07 PM
0
Q: Bower installation errors on Windows, ENOENT, ENOTEMPTY

user2368162I am on Windows 8, running command prompt as administrator. I run this command: npm install -g bower This gives me errors. I can't provide the full output to npm-debug.log since I am limited to 30000 characters. StackOverflow complains about the length of my post and that it appears to contain...

 
2:45 PM
0
Q: Problems minifying/aggregating CSS/JS files with Symfony 2.5 and UglifyCSS/JS

sjagrI have followed these instructions in order to enable both UglifyJs2 and UglifyCss on my development environment (to start with... can't risk taking down the production server with this problem!) Under my config_dev.yml I have configured the following (I've started with just the bin parameters b...

 
2:57 PM
0
Q: supertest with express 4 and multer/busboy

PatrickAnyone got supertest to work with express 4 and busboy/multer? I can't get anything in req.files/req.body and busboy doesn't react the on('file') event. I assume there's an error in how supertest handles .attach() and .field(), but I can't find a solution.

 
3:15 PM
0
Q: How to add http:// to url if no protocol is defined in javascript?

nearpointMy question is the same as this one, but the correct answers are for PHP not javascript. How to add http:// if it's not exists in the URL? How to add http:// to the url if there isn't a http:// or https:// or ftp:// ? Example: addhttp("google.com"); // http://google.com addhttp("www.google.c...

 
3:54 PM
0
Q: Node.js Express block

ObatzerI'm new here, so I hope you won't be too mean to me :-) My Problem is, that I'm planning to use express to cache all requests which I receiver for a certain amount of time until I send all responses at once. But unfortunately I can't receive a second request until I've responded to the first on...

 
4:08 PM
0
Q: 404, file is there and in the same folder

Andi GigaI run a ghost-blog (node.js): http://autofokus-marketing.de/das-geheimnis-erfolgreicher-webseiten/ In the ..mytheme/app/js folder is a javascript (angular). The script makes a post request within the same folder to: mailchimp.js When I go into Chrome Developer Mode it tells me 404 not found. W...

0
Q: decode sqldeveloper connection password in nodejs

tojockyI'm facing the issue how can I decode the SQLdeveloper connection password in node.js. The issue to me Oracle passwords are periodically changed which breack all my scripts. The only way to get it, is connection list.

0
Q: Mongoose: having nested schemas with different key/values

Maxim GeerinckI am having the following situation: A person can own multiple products. These products each have their own config fields. I came up with something like this: var UserSchema = new Schema({ ... productsOwned: [ { _id: {type: ObjectId, ref: 'Product'}, con...

 
user2862309
@Ahmad, could you please give more clear definition of SO activity and how can I request access again, since I see a guy called Ak_Crusaider who has only 31 SO points and I have more
 
user2862309
sorry for calling you here but there is no way to interact with you in the Android room
 
user2862309
@Ahmad?
 
@Mr.Meshuggah Yeah Ak_ somehow got in although his rep is really low, but we are making sure help vampires aren't flooding our room, since this seem to happen quite often lately. We are getting lots of requests from users with 20< rep and most of the times these people are beginners.
You seem nice though.
are you new to android development?
 
user2862309
yes
 
user2862309
4:21 PM
quite new
 
user2862309
I actually did more Java programming
 
user2862309
I have 42 rep
 
user2862309
but I haven't used my profile for a while
 
user2862309
cause I was on a mission in Nepal
 
user2862309
for 6 months
 
user2862309
4:22 PM
so I did more spiritual stuff rather than computer
 
user2862309
but I started recently
 
user2862309
sorry if it sounds a bit crazy
 
lol no worry
 
user2862309
so tell me what I could do?
 
user2862309
should I be more active some days
 
user2862309
4:23 PM
I am not a help vampire, actually I can bring you a lot of knowledge to the channel
 
user2862309
cause I have been programming for quite a while but went crazy cause of it (like OCD and stuff for a while) that's why I needed a break for a bit
 
Hmm okay I'll let you in
But please be sure to not ask any beginner questions etc.
is that okay with you?
 
user2862309
I agree with the terms & conditions
 
:D
 
user2862309
you can ban me if I do
 
user2862309
4:25 PM
:)
 
user2862309
I have read the rules
 
user2862309
also
 
user2862309
 
4:40 PM
0
Q: Are the extra stdio streams in node.js child_process.spawn blocking?

BartvdsWhen creating a child process using spawn() you can pass options to create multiple streams via the options.stdio argument. after the standard 3 (stdin, stdout, stderr) you can pass extra streams and pipes, which will be file descriptor in the child process. Then you can use a fs.createRead/Write...

0
Q: Disable Type Checking in Mongoose

Dropped.on.CapricaIs there a way of disabling Mongoose from checking the types when saving? I'm converting a bunch of documents to a newer format, so type checking isn't super-important for me (after running the conversion scripts the data will all be in the correct format/ location). Any ideas? I thought about...

0
Q: nodejs remote http using socket.io

ValRusI want to connect nodejs via socket.io to http, but not at the same environment. So it is not like express does, in the same dirrectory routes to public folder, but in the folder at remote host. Is there a way?

 
4:51 PM
0
Q: NodeJS HTML5 Audio Player MPEG File

tejas-manoharWe're receiving a direct link to a MPEG Audio file from a certain web streaming API and need to present it in HTML5 audio player. This isn't truly an MP3 with MPEG codec, but an MPEG video format with pure audio only. Is there a workaround to get an MPEG into an HTML5 audio player? Or to put it ...

0
Q: Parse: Query inside of post doesn't run

MaxwellI have a post call that is being triggered from an ejs file. I want the post call to update an object in a Parse database, so I try to perform query.get(id, callback) in order to retrieve the object I want to edit, but it doesn't seem to return anything. I performed a query.find in a related get ...

 
5:08 PM
0
Q: read folder name with nodejs and setup as variable

user3821470Its possible check if some folder exist and if exist read or take the folder name and set as variable? Thanks

0
Q: chrome dev tools "save" not working while debugging node.js app

Pavle LekicWhile debugging node.js cli script in chrome dev tools (that is possible http://youtu.be/03qGA-GJXjI), I cannot save the changes I made on the fly like I can when I debug normal javascript from a website. I get an error message: "Debugger.setScriptSource failed. LiveEdit Failure: Failed to compi...

0
Q: "express" command not recognized

taufiqueI am using Windows 8. I have followed the steps of this link to install node.js and express. But when I am creating a project with command express project_name, I am getting following error message - 'express' is not recognized as an internal or external command, operable program or batch fil...

2
Q: Simple authentification with passport.js turning into infinite loop

Su4pI'm sure, I'm doing something wrong coz of my lack of experience with this technologies. So here I'm trying to authenticate my user. in server.js I have the following : var express = require('express'); var app = express(); var port = process.env.PORT || 8080; //var configDB = require('./c...

0
Q: Correct way to write loops for promise.

user2127480How to correctly construct a loop to make sure the following promise call and the chained logger.log(res) runs synchronously through iteration? (bluebird) db.getUser(email).then(function(res) { logger.log(res); }); // this is a promise I tried the following way (method from http://blog.victorq...

0
Q: Running Browser as terminal process

JerryFoxI am trying to do some high scale testing with my nodejs server so I want to find out how its possible to run the chrome browser on the terminal, similar to how nodejs runs the server. I want to have a few hundred on a single machine which is why I want to avoid running the actually browser tab ...

 
6:21 PM
0
Q: NodeJS Winston DailyRotateFile not writing

FluidbyteI'm trying to setup a simple daily rotation log write with: // Create file transport transports.push(new winston.transports.DailyRotateFile({ name: 'file', datePattern: '.yyyy-MM-ddTHH', filename: path.join(logPath, 'http') })); // Create new logger var logger = new winston.Logger({ tra...

0
Q: NodeJs SSL on Gandi Simple Hosting: listen EACCES

superHHI am pretty desperate, the following problem is haunting me for weeks now: I am encountering the "listen EACCES" error on my Gandi Simple Hosting instance, when i try to run my NodeJs instance on port 443. Is there something i did wrong i didn't know about? I must say that I'm very new to the who...

0
Q: Express 4.0 Router Returning 404 for a particular route

Chetan BhasinI just switched to Express 4.0 and apart from the predefined routes, I cannot find a way to create my own routes. Here is the code: In app.js: var register = require('./routes/register'); app.use('/register', register); In /routes/register.js: var express = require('express'); var router = ...

0
Q: Download PDFs from Automatic Download Links with Node.js Scraper

user3821746I am making a scraper with Node.js (using Request.js and Cheerio.js) and am navigating to download links to download PDFs and add them to a folder on my computer. The links start the download automatically, they don't just navigate to the rendered PDF, so I am not sure how to pipe the download to...

0
Q: Handlebars JS Precompiled Faster Than Just Rendering On The Server?

Shannon PerkinsI apologize in advance for the total noob question about Handlebars. I'm coming from a Rails background and while Handlebars looks cool I'm having trouble seeing it's advantage over compiling views on the server. So here are the questions. Currently, our apps compile Handlebars JS templates on ...

 
6:43 PM
0
Q: Accessing objects in jade sent from res.render expressjs

deadmanI have a route in my express - app.get('/profile/:profileId',auth.requiresApiLogin,users.getProfileView); and exports.getProfileView = function(req,res){ User.findOne({_id:req.params.profileId}).exec(function(err,user){ if(err){ res.status(400); res.rende...

0
Q: Express.js 4.0 -- use separate view directory for each router

ErichI'm using Express 4 routers to separate out two different app functions. Each app function has its own set of ejs view templates, with conflicting names (e.g both have a search.ejs). How can I specify the router to use only a particular view directory to render views? For example, the view dir...

 
6:54 PM
0
Q: Problems with running node module

BloodcountSo, I am getting the infamous error: module.js:340 throw err; ^ Error: Cannot find module '/home/bc/projects/nodejs/pg-connect.js' at Function.Module._resolveFilename (module.js:338:15) at Function.Module._load (module.js:280:25) at Function.Module.runMain (module.js:49...

0
Q: How to select document by id with Sails-mongo?

user3821798User.find({ _id: { '!': user.id } }, function foundFriends (err, friends) { if(err) return next(err); res.view({ friends: friends }); }); MONGODB : { _id: ObjectId("53b942f7c8638f7b17670acc"), name: "PH", admin: true, online: false, encrypted...

 
7:05 PM
0
Q: Node.js calling a callback function inside loop scope issue

AitorI am building the following code: for(var i=0;i<datos.length;i++){ bittrex.getticker(datos[i].Currency,function(err, data){ if (err){ console.log('ERROR:', err); return 'ERROR:'+ err; } else { if (data.message!='INVALID_MARKET') { ...

0
Q: createInterface prints double in terminal

dopatramanwhen using the readline interface, everything from stdin gets printed twice to stdout: var rl = require('readline'); var i = rl.createInterface(process.stdin, process.stdout); when i run this code, everything i type in the terminal is duplicated. Typing 'hello world' yields: hheelloo wwoorrl...

1
Q: Can IoC frameworks make objects with dynamic constructor parameters?

djechlinHere is how to set up Pico Container with Java: public class Juicer { private final Peelable peelable; private final Peeler peeler; public Juicer(Peelable peelable, Peeler peeler) { this.peelable = peelable; this.peeler = peeler; } } Configure: MutablePicoContainer pico...

0
Q: Socket IO push notification with JBoss

amrit_neoI am having a web application written in angular and running in JBOSS, I am using REST to get data from server to UI. I want to know if we can send push notification using Socket IO to all the users logged in to my JBOSS application. So, the socket IO must receive message from my Application ba...

0
Q: How to properly nest in jade

RandomDeductionI am trying to write jade to output the following html: <p class="para"> This is my post.content.brief text <img src="my_image.png"/> </p> The post.content.brief variable must be escaped properly. Here is what jade I have so far (non-working): p.para img(src=my_image.png) != p...

 
7:35 PM
1
Q: .then(success, fail) antipattern for promise

user2127480I had a look at the bluebird promise faq, in which it mentions the .then(success, fail) antipattern. https://github.com/petkaantonov/bluebird/wiki/Promise-anti-patterns I don't quite understand its explanation as for the try and catch. What's wrong with this the following? some_promise_call() ...

0
Q: Find the number of IPs connected to a port using Nodejs

NyxynyxThe following command tells you which IP addresses are connected to port 1234 and how many connections there are from each IP address. netstat -plan|grep :1234|awk {'print $5'}|cut -d: -f 1|sort|uniq -c|sort -nk 1 Results 1 0.0.0.0 1 107.123.93.244 1 107.123.141.5 1 107.123.228.217 1 108.123....

0
Q: bash commandline jslint wont scan file and wont give an error

Hello-WorldWhy wont my jslint scan a file in bash? On a fresh install of kubuntu I installed node sudo apt-get install node Then sudo apt-get install npm Then sudo npm install jslint -g All installs worked well with no errors my issue comes when I type: I use tab to auto complete a@a:~/Desktop...

 
8:14 PM
1
Q: Use File Content to Determine MIME Type with Node JS

KirkIt seems all of the popular MIME type libraries for node.js just use the file name extension rather than peeking into the file to determine the MIME type. Is there a good way to use Node to jump into the file and intelligently determine the file's MIME type in case an extension is not present?

0
Q: unit testing using jasmine titanium node.js

user3754111I am very new to this, and I am quite confused. I have a utilities class, and I want to unit test this function: utilities.js function lzero(str, len) { str += ''; // cast to string while (str.length < len) str = "0" + str; return str; } //expor...

 
8:33 PM
0
Q: Scalability Test with Nodejs & clients Limits

JerryFoxI have been trying to run scalability tests with my Node server and a few hundred clients, (eventually want to go over a thousand.) My problem is that is seems that in the end only 230 client.js respond back. Here's my testing logic: Right now I have a bash script for testing latency that launc...

 
9:32 PM
0
Q: how to remove documents from multiple collections using mongoose

YashI have following schemas and I want to remove a document from a collection and at the same time i want to remove all the object id's of that document from other embedded documents. var mongoose = require('mongoose'), Schema= mongoose.Schema; var productSchema= new Schema({ pna...

0
Q: How to integrate underscore into mean.io

tivoniI'm new to mean.io and node.js in general. Started developing a mean.io module and I wish to use underscore in client code, specifically - in a controller file under packages/myModule/public/controllers/ It is my understanding I can pull it in with bower, and I did so it's there. That said, i...

0
Q: How to use Passport.js and Node for Single Page App

ExitosI don't think a problem has ever annoyed me like this. Seems like there are literally 0 places to look or answers to this. All I want to do is get passport to intercept a call to '/login' and '/getloginStatus'. When logging in I just want to use a Json object as parameters for {username/passwor...

0
Q: node-mongodb-native error when using geoNear

sf_joshI've looked everywhere, and simply can't figure this out... I can get it to work in the mongo shell, but not in my application. Here's the code. I can get it to work here... (using the MongoDB shell) db.runCommand({geoNear: 'prints', near: {type:"Point",coordinates:[30.3,-40]}, spherical:t...

 
10:42 PM
0
Q: Change path separator on NodeJs

Eduardo RodriguesI'm using grunt-bbb-styles to process my css files My css is like this body { letter-spacing: -0.3px; background: url("../images/outer_bg.jpg") repeat; } after bbb-styles executes it became body {letter-spacing: -0.3px; background: url("/app\images\outer_bg.jpg") repeat;} See the backs...

 
10:52 PM
0
Q: Accessing the socket that emitted a message in socket.io

drewblaisdellI have a class named GameServer which has methods for handling various socket.io messages. Here is a brief example: var GameServer = function(app, io) { this.app = app; this.io = io; this.io.on('connection', this.handleConnect.bind(this)); }; GameServer.prototype.handleConnect = function(...

0
Q: How to aggregate data to an array output | Mongodb

opcodeSo I have the following data in a collection { "UID" : 567, "AN0" : 100, "AN1" : 150, epoch:1401399336437 } { "UID" : 123, "AN0" : 200, "AN1" : 250, epoch:1401399336438 } { "UID" : 567, "AN0" : 300, "AN1" : 350, epoch:1401399336439 } ... For UID:567 && AN0 I want to get an output s...

 
11:09 PM
0
Q: Relative paths to js files in a parent's sibling folder not reachable through express?

u353I've configured express as follows: var express = require('express'); var app = express(); app.get('/', function(req, res) { res.sendfile(__dirname + '/3in1/src/index.html'); }); app.get('/index.html', function(req, res) { res.sendfile(__dirname + '/3in1/src/index.html'); }); /* serv...

0
Q: Update a Nested Array in MongoDB

user3803096I have many company documents like this: { "name" : "testCompany", "code" : "150", "access" : [ { "name" : "x", "role" : "admin" }, { "name" : "y", "role" : "User" }, { "name" : "z", "role" : "User" } ] } I want ...

0
Q: Is it smart to keep static files in memory in node js?

KirkWhen serving static files in Node I am simply using fs.readFile and then throwing the data onto the response content. I am tempted to store the results of fs.readFile in a variable and then skip using fs.readFile when the file is requested a second time and just write the content out from the va...

0
Q: How to use Node.js to read data from a json file and display the read data into html?

user3669481I am a complete newbie and just did something like this: var fs = require('fs'); var file = __dirname + '/data.json'; var http = require ('http'); var server = http.createServer(function (req, res){ res.writeHead(200); fs.readFile(file, 'utf8', function (err, data) { ...

0
Q: Using https with socket.io 1.0.6 and getting an ERR_SSL_PROTOCOL_ERROR

Justen PalmerI've been using https with socket.io on version 0.9 and below successfully for years. I went to upgrade to the new 1.0 version and I'm getting an SSL error. Here is the server-side node.js code to start the socket server: var options = {}; options.key = fs.readFileSync('certs/ssh.key'); option...

0
Q: GulpJS minify-css throwing an error that I can't make out

user1797484I am attempting to use GulpJS to minify my css. This was working fine yesterday, I don't think I made any changes. I'm really unsure what this error message is telling me. var minifycss = require('gulp-minify-css'); var autoprefixer = require('gulp-autoprefixer'); var cssDir = 'app/assets/css...

0
Q: Figure out if code is even executing in sails.js

endyI've been attempting to work with Sails.js. Unfortunately, I'm beginning to think that it's just not stable enough to be used at all. This is strange because there seemed to be quite a bit of hype for this framework. Basically, I am just trying to figure out if my code is even running. I've c...

 

« first day (53 days earlier)      last day (24 days later) »