I've been researching the proper way to handle errors in Node and have found some good answers here on StackOverflow and on NodeJS' site, such as How do I prevent node.js from crashing? try-catch doesn't work and the NodeJS docs which the answers lead me to: http://nodejs.org/api/domain.html. Ho...
I'm trying to set up an environment that supports angular/coffeescript/sass/jade.. and was told angular-curve does an excellent job. I get stuck at this part: after cloning the repo and running npm install I get this error: npm ERR! peerinvalid The package karma does not satisfy its siblings' ...
So I've been using sailsjs to request json data from an external website and then posting that data to the create route. When I first run it, it will work for around 10-12 times and then the application will crash with event.js throw er; connect ETIMEDOUT Looking for a better way to request json...
I have node app with Passport (Facebook-strategy) + route + Express.io. I can successfully login with Passport Facebook strategy and the functionality is fine in every one of the app.get('/path', function(req, res) {}); but when I came to app.io.route('test', function(req) {}); (with express.io) ...
I am running node js with log4js to see logs. But unfortunately i am getting, these errors in my cheese.log, [2014-05-25 10:54:17.566] [ERROR] console - AAArgh! Something went wrong { some: 'otherObject', useful_for: 'debug purposes' } [2014-05-25 10:54:17.570] [ERROR] cheese - Cheese gouda is t...
I bought some domains at godaddy.com (i.e mydomain.com) for my droplet at digitalocean.com (i.e 199.216.110.210). I run a nodejs application on port 80 on the droplet. From godaddy.com, I forward with masking mydomain.com to 199.216.110.210 and I could see may app. Now I want to run on 199.216.1...
I am beginner in node.js development. I have written following code to start multiple instances of http server running on different ports. You can observe that the Cluster has 2 function start and stop. The start function works fine, however, I ain't sure what to write for callback? The second an...
I'm currently working on an application that will rely on Socket.io on a Node.js server communicating with a Django backend. The component of this application I'm having trouble with relies on an external service to trigger a message within Django. I thought of using a simple GET/POST request to ...
In my local computer, I have a programm that scrappes data from some website, periodically, once a day. The scrapping process transform the data from the html pages to a list of objects (This was developed in C#) I want to upload the data to a database on a cloud hosting service (such as OpenShi...
Is there any modules or other services that do a decent job at parsing a resume in PDF, Doc, or TXT format into something standard like YML. I could not find anything on npmjs.org
I am having trouble reading files in different locations (other than the Node project directory). I need to read a private key file (could be located anywhere on the file system) and transfer some yaml/yml files (also could be located anywhere) via sftp. These files are selected in a file input f...
I'm currently trying to spawn a child process to handle some POST data with NodeJS (using Koa framework). Ideally, I would like to wait for the child process to finish before redirecting, but since the child process is asynchronous, the code always redirects first. I've been trying to fix this f...
I'm beginner in NODE . I've opened a new project in Webmatrix 3. There is a default js file server.js. Working on port 8080. When I'm runnig the project it's work fine . But when I'm trying to run another js file in the project as helloworld.js i see the result of default file! It's happen even i...
I have installed node.js and the version is 0.6.12 . I am trying to update it but the efforts are invain.Even though i have installed the latest version the Terminal still shows the version as 0.6.12 which means that the installation is not successfull. Please help . The screen shot is http://tin...
I'm trying to get this code to work (node+mongoose) model.find({ $and: [ { 'location': { $near: { $geometry: {type: 'Point', coordinates: [lat, long]} }, $maxDistance: 1000 }}, {'status': { $size: 1 }} ] }, and keep on getting can't find any sp...
I have created two models A, B. They have A.HasOne('B') and B.belongsTo('A') reationship defined between them. I have set up the routes as described in http://kieran.github.io/barista/#resources router.resource('A') .member(function(){ this.resource( 'B' ); }); which results in error ...
I'm trying to develop a nodejs application for my ios app and admin web pages. I have a REST api for my ios app and some web pages for the admin section. I'm using OAUTH2 for authentication on ios app and default basic authentication for the admin pages. The problem is that the session/cookie is ...
I'm getting the following error while running the cordova command on Windows: module.js:340 throw err; ^ Error: Cannot find module 'C:\Users\[username]\AppData\Roaming\npm\node_modules\cordova\bin\cordova' at Function.Module._resolveFilename (module.js:338:15) at Function.Module._load (mod...
I hope to pack the nodejs(includes its installed module via npm) and javascript code to one execute file for different plateform(windows, osx, linux). Is it possible or any solution? Your comment welcome
I've been pulling my head on this one for days... I'm using Node.js to make http calls to Google maps REST API's I need to go over records of locations in my database, and using the lat,lng - find the google location id or reference in a given resolution - say "country" or "administrative_level_1...
I have the next code with http module: function PostCode(stream) { // Build the post string from an object console.log("Start upload: " + stream); console.log("A"); var post_data = JSON.stringify({ 'stream' : stream, }); console.log("B"); // An object of opti...
I am following the wonderful node-express-mongoose-demo app (link in the articles.js controller, the .load function has a next() statement and I am confused about it - I thought that next() was only used in routing, passing the flow to the next middleware. why is next() being used here inside a ...
I am writing some express middleware that needs to access a database. It is going to be released as a package so I want it to be as self contained as possible. I was wondering how I should handle the connection to the database. It is async(of course), but it only needs to happen once. Where shoul...
I have created a text index on the 'num' field in the collection. Now while passing the string to search from the text index, I need to use a regex which has to be passed as a string to the $search variable. My current query works fine but it doesnt work when I add a regex to it. Current Query:...
I'm working on a nodejs project. I'm using passport.js for my authentication, it works perfectly, but i'm in trouble when I try to get the username of some people using soundcloud. here is my the part of my code I use to store the profile informations in my database : function findOrCreateUser ...
I don't understand the difference between these two ways of checking if a variable is undefined: if (typeof res.locals.user.hashnodes === 'undefined') { morphemes = 0; } and if (!res.locals.user.hashnodes) { morphemes = 0; } For me, only the second option works, the first on...
I'm using a MEAN stack and looking to integrate Passport into it. However, I am not entirely sure how I should structure it. I eventually want to include several Strategies, but lets start with Google. In my routes.js file I have: app.get('/auth/google', passport.authenticate('google')); app...
I am using multer to capture file posts. As you can see below, The rename function manages the uploaded file and the file gets saved automatically in the uploads directory. Now if I were using two routes and I needed different functionality for each of them,say for one route I would like to rena...
I am new to MEAN stack development, but I'm pretty sure i'm going to use it to create my next SAAS single page application over Codeigniter and MySQL (which I've used for 3 years). I have been told by many people that the best way to start using this stack is to create your API first. I am new ...
Running through this useful walkthrough for Node.js authentication with Passport, but utilising Jade templating rather than ejs. When actually running the app, the correct values are displayed in the HTML, but it annoys me that command-line jade complains. Any ideas why? Here is the calling co...
The userlist collection contains documents of the following format. { "_id" : ObjectId("5381d32ce72cc794166eede2"), "name" : "Haseeb", "password" : "dgkhan", "email" : "[email protected]", "address" : "237 D, Faisal Town , Lahore", "phone" : "51628...
I want to use Ghost blog engine for free like WordPress and cannot find any free and fast node.js hosting for it. Is there? I have checked cloudno.de, Nitrous.io and Heroku, but first one, cloudno.de, is in private beta (I subscribed for it), and others are so slow for personal blog.
I have a client sending the following request: Host: blah User-agent: blah Connection: keep-alive Content-type: application/octet-stream Content-length: <length> <binarydata> On the server side: http.createServer(function(req,res){ console.log("here"); req.on("data", function(){console...
I'm having troubles trying use http-proxy to route to localhost. I'm using IISNODE but from a Console App is not working neither. If "target" is set to google for example, it also works with local:9000 that is created in this snippet but it doesn't work with sites running in my local IIS Any ...
I know using global variables in javascript is bad practice.Here i am using config,host and port as global variables as i have added a watch function to watch for the changes in the config.json file.Is the use of global variables in this example a bad practice or is it ok to use. config.json fil...
I'm having a bit of a problem here. I'm working on a backend on NodeJS for a Sencha Touch app and at some point I'm calling a function, but I'm getting to next line of code before getting that functions return statement. Here's my code... .... for loop .... if(resultSet[k].id_bus == bus...
I am trying to understand some code about session storage and generation in Express JS and Node.js: Store.prototype.regenerate = function(req, fn){ var self = this; this.destroy(req.sessionID, function(err){ self.generate(req); fn(err); }); }; In the above piece of code, there is...
So, I have a NodeJS IRC bot. What I want to be able to do is to check whether a UDP server is up, or not. As I'm not an expert at network protocols, nor do I know NodeJS all that well, I've been unable to get such a thing working. I've been trying some examples I've gotten over the internet, but...
I am using node-mysql in my project. I have a scenario where the execution of the second query will be based on the result returned from the first. For example, first query, select * from table where user=x; then based on the existence I will run another query. I am using pool.getConnection(). Ma...
I'm little bit confused after try to solve how to install a module globally using npm. I installed Node using a .dmg package from official site. This is the final log. Node was installed at /usr/local/bin/node npm was installed at /usr/local/bin/npm Make sure that /usr/local/bin is in you...
This is my first attempt at building a Node module; the purpose is to parse a file (typically an HTML file), look for specific matches, and do something with those matches. I'm using the fs module to readdir, find each file in that directory, and then pass off each file to readFile, which return...
I have followed the examples on many sites that indicate how to make a single room chat using a nojejs server (using the nodejs "net" module). my clients are written in c#. How can I make chat rooms with the "net" module? It should be like I can see all my friends and then decide to chat with one...
I can get room's clients list with this code in socket.io 0.9. io.sockets.clients(roomName) How can do this in socket.io 1.0?
Pretty sure this is a quite noobish node.js/callback question but I can't seem to find the proper code to make it run. This is how I invoke my node-mysql code: var utils = require('../../config/database/utils'); exports.getResults = function(callback) { var query = "SELECT * FROM my_table...
I've created an image uploader using angular-file-upload and the file passed through the form gets parsed server-side in my Express app and then writes the image to a directory on the server, so the good news is that the whole image uploading part works as it should do. The problem I'm having is ...
I have written my first webapp in Node.js with Express and MongoDB. As a foundation, I have used this example. Everything runs smoothly when testing locally, and also at first when it is running on the server (which is a Ubuntu server that I connect to via SSH and use PM2 to keep the process run...
I'm creating a cli tool which communicates a great deal with the github API. As github rate-limits after 60 requests I need to offer the user the opportunity to sign in. I'm new to oAuth and all the examples I can find on the github site seem to relate to authenticating a web based tool, where th...
I'm quite new to NodeJS/Express/Socket.IO and have made a simple rock-paper-scissors app using Socket.IO communication (on the client-side I'm using AngularJS). That part of the app worked quite fine so far. However, I started working on implementing sessions using Redis and have stumbled upon ...
I'm new to RabbitMQ and MQ's in general. I'm using the rabbit.js Node.js module to interface with RabbitMQ, so all my application layer is going to mainly be in Node.js. What I'm wondering is, how do I manage RabbitMQ? How can I see everything that's going on with RabbitMQ, from what's messages a...
When I run npm install -g <package> it installs the packages in my user/AppData/Roaming/npm/npm_modules/ folder. This sub-folder is not in my PATH so if I try to run the package without explicitly calling the entire path the call fails with a '<package>' is not recognized as an internal or extern...
I'm trying to get my application deployed to a public domain using node.js, express.js, and Heroku (or Modulus.io). Everything was working fine in the development environment. But when I try to deploy it to Heroku or Modulus, I run into a lot of problems with PORT and Express. Right now I'm tryi...
I want to build a real-time web application that runs on a local server and on an online server at the same time. Let's let me make an example to explain my problem: so let's assume there is a company which uses the program and they fill it with some data. At the same time there is someone far aw...
I am implementing a parallel NodeJS application to compute spatial joins. I am running on a MacBook pro i7 processor with 4 cores (8 after hyperthreading). To make a fair comparison, I am running exact same operation on all threads. I am attaching activity monitor screenshots for the reference. ...
I have a very strange problem with a webpage I made with Node.js + Express.js. My webpage is multilanguage (english/spanish), so in the Jade templates I have translations IDs wich correspond to a text depending on the selected language. Ok, that works well. Now, when I search the webpage in Googl...
I have a couple of collections that I want to be cleared every time I start up my app. The problem is, since i'm using a PaaS (http://modulus.io), instances could start and stop quite often. If I do clients.remove({}) in my startup, the entire collection will be cleared even if one instance dies ...
« first day (8 days earlier) ← previous day next day → last day (69 days later) »