I need to perform a series of actions on a variable, where the output of the previous action would be the input of the next one. Also, there is a possibility that at each step the whole process aborts in case the input is not well formed. I know this could be done with the callback functions, b...
I am trying to wrap my head around developing an SAAS application with MEAN stack rather than PHP and MySQL. I need advice on a good way to create a multi-tenant application with mongodb. I know from previous reading that I don't want to do one database per customer because of the large size of a...
I'm new to web development. I'm writing an application with Node.js and want to use MySQL. I'm not sure how web technology works, but would people visiting my site be able to see my database credentials? According to the MySQL documentation (https://github.com/felixge/node-mysql) this is how to c...
My events colleciton stores the following documents: { "_id": { "$oid": "537b2a232a47f21830ae5b7b" }, "startTime": { "$date": "2014-05-18T21:00:00.000Z" }, "endTime": { "$date": "2014-05-18T23:00:00.000Z" } }, { "_id": { "$oid": "537af8136c4162d0379e2139" },...
I follow this sample code to push notification to browser, I follow the instructions and run the app using node server.js and I open the browser and run localhost:8000 and change text in example.xml and save it then the text pushed to browser. But I still don't get it to implement to another app...
I am using a Nodejs app with npm module- elasticsearch. Should I instantiate Elasticsearch client every time I make a call to an ES API or should I create only 1 instance of ES client and use it for every request or should I use a mix of the above and what's the difference between them.
I get an error when I run file example4.js that test another file example3.js. This is my code: **//file example 3** var http = require('http'); var fs = require('fs'); // write out numbers function writeNumbers(res) { var counter = 0; // increment global, write to client for (v...
I want to fetch documents updated within last 30 minutes each document has updatedAt field of Date type I am doing the following : Model.find({ updatedAt : { $gte : new Date(Date.now() - (30 * 60000)) } }, function(err, docs){ console.log(err); //null console.log(docs); //empty a...
I use mongoosejs as driver to MongoDB server. I have the schema that have date field: time : { type : Date, default: Date.now } But I need to store datetime in specific timezone instead current server. How could set default time in specific timezone?
Guys I'm getting error when I try to write information into serial port. I din't get any compilation errors as you can see in the result below. But When I write using serial.write(); I get error as undefined. connect.multipart() will be removed in connect 3.0 visit https://github.com/senchalabs/...
I'm trying to install zombie js, and get this error: > [email protected] install C:\Users\User\Documents\ArbeitPhilipp\clieman\billing\node_modules\zombie\node_modules\jsdom\node_modules\contextify > node-gyp rebuild Das System kann den angegebenen Pfad nicht finden. C:\Users\User\Documents\Arb...
I have to parse json items with a date field formated as follows: 'Wed, 14 May 2014 20:19:00 BST' How can I get the timestamp from this kind of string ? Constructing a Date object doesn't work as it gives me an "Invalid Date"
When I send a message to multiple rooms, and some socket connections are subscribed to more than one of these rooms, they receive the message multiple times. For instance: ['room1', 'room2', 'room3'].forEach(function(room){ io.sockets.in(room).emit("statusChange", {user: 'user1', status: 'o...
I'm developing some HTML-files using a lot of different libraries, but everything is compiled and served using grunt ('grunt serve'), which fires up my default browser and connects on 127.0.0.1:9000. I can copy/paste that URL into other browsers on my OS (Mac OS X) with no issues. However, I als...
I have created an image upload script using Express which is working fine. The problem I'm having is that I'm trying to do some server-side image manipulation with GraphicsMagick for Node but in each of the solutions below containing gm, I'm getting EPIPE errors and I don't know how to fix this s...
I'm using Juggernaut with (PHP + Redis + NodeJS). On the client side, how can i use callback function when the channel has disconnect? I've trying: var socket = new Juggernaut(); socket.on('disconnect', function() { $.post('/test/user-leaving', function(res) { //do som...
I'm just starting with Node.js but I have experience with client-side JavaScript and PHP/Apache. In your browser you can execute JS code from the developer console at any time. You can manipulate global vars and call global functions and methods. If I call console.log('Hello world!') from the br...
I'm migrating my tumblr blog to docpad and have started with this boilerplate: https://github.com/ervwalter/ewalnet-docpad Now my problem is that "docpad run" takes 58s to run, and a livereload run takes 23s. I wrote the author of this boilerplate and he says he is having the same, but it doesn'...
I am using socket.io on port 8081 and express with redis on 8080. I cannot use both on the same port or I get a conflict. When the code below is run the php session is logged in the console and I get the socket.io started message but there is nothing further from socket.io logged to console. I'...
I just ran sudo npm update -g and the output contained warning messages about unmet dependencies. Here's an excerpt: npm WARN deprecated [email protected]: use grunt-wiredep instead [email protected] /opt/local/lib/node_modules/bower/node_modules/chalk/node_modules/strip-ansi intersect@0....
I have installed node and npm. After which I installed yeoman using "npm install -g yo". Later I installed webapp generator using "npm install -g generator-webapp". Now that everything required was installed I used "yo webapp" command" and "yo" command. Both failed giving me this absurd message ...
I bag your pardon. May be I'm ignorant, may be I'm boor and I can't ask correctly on StackOverflow but I have nowhere to go and implore you to help me. I write a WPF application which is two-level master-details and uses XML file as data source. Data from this file is displayed in application mai...
I am using a node.js chat server which sends ASCII messages containing the id of the users and unicode messages as text messages. How can I determine the type of encoding in the C# client? As server-side I am using node.js with "net" module.
I am debugging a token-based A&A module in node.js + angularJS. In this approach, server authenticates the user and responds with a token. This token is saved in a local memory (client side) and user sends the token on every request to the server using the attached code. However, I face a weird...
In expressjs 3 I could do var port = process.env.OPENSHIFT_NODEJS_PORT || 8080; var domain = process.env.OPENSHIFT_NODEJS_IP || "127.0.0.1"; http.createServer(app).listen(port, domain); in express4 var server = app.listen(app.get(port), function() how do you add domain in expres...
I got a small problem. With this code I updating a existing document in mongodb using node.js and mongoose router.route('/profile/:profile_id/:session_key') .put(function(req, res) { if (req._body == true && req.is('application/json') == 'application/json' ) { // Get the ...
i use the link word as told, but still can not see the css file invoke successful. app.js var express = require('express') , cons = require('consolidate') , jade = require('jade') , path = require('path') var app = express() app.engine('jade', cons.jade) app.set('views',__dirname)...
Right now I'm working on a project in which I'm requesting an API server and the responses from the server are stored in seperate mongodb collections but issue is that responses' data get overlap and both collections have merged responses' data stored in them. The logic which I'm using for doing ...
Currently in my Node.Js app running on Neo4J I use node-uuid module for giving unique IDs to my database objects. Using uuid.v1() function from that module I get something like 81a0b3d0-e4d0-11e3-ac56-73f5c88681be Now, my requests are quite long, sometimes hundreds of nodes and edges in one...
I've started node server with forever forever start server.js I verified it with forever list and also with opened the 3000 port in iptables and made sure that the port is open and listening with nmap. So node is runing and the app responding but i can't access it trough my ip xxx.xxx.xxx.xxx:...
I'm learning Javascript / Node.JS and it's going well but I ran in some trouble with the code below. When I open the page that emits a hit it outputs the trck_visitors array in Node.JS however. On the first hit this array is empty, it does not show the trck_visitors[socket.id] which I just set. I...
There is a part of my script where I need to use a function, which takes req and res data as its variables. Is there any way to populate them without actually having to submit a form, something like req.body.entry.body = 'this is a test post about things that are apples'; and res.l...
So I have a table of users which includes the columns 'user_id' and 'points'. Now, I want to update multiple rows using the Map/Array [{id: 1, points: 2}, {id: 2, points: 4}, etc...]. And another problem is, I want to ADD to the points values, so building a query-string using a for loop is somew...
I am trying to use the dc charting package with node.js. Just getting a very basic pie chart (with hard coded data, etc) to work seems to be quite challenging. I tried following the only guide I found for node: dc.js with node.js server side basically it uses jsdom to construct a DOM and place ...
I downloaded the git repo from the official link, git clone git:// and I ran ./configure && make && make install where the make install returns with error: LINK(target) /usr/local/bin/node/out/Release/node: Finished touch /usr/local/bin/node/out/Release/obj.target/node_dtrace_header.stamp...
During the last months, we at work have been looking for a solution to the following problem: front-end developers can't easily modify the appearance of the website without needing the help of back-end devs. Our culture as a team is mostly based on full-stack frameworks such as Symfony 2 and Rub...
Is it possible to run a tcp server in nodejs on multiple ports? var socketServer = net.createServer(function (socket) { socket.on('end', function () { }); socket.on('error', function (error) { }); return socket; }).listen(8080); Any ideas how the above could als...
I am trying to connect to the Google Cloud Datastore using node.js and the data layer functionality present in the Seneca framework. The Seneca framework needs to create a connection to a database as per connecting to a database instance, passing information like: name: '', host: '', port: , use...
I'm trying to install couchbase with node.js. I'm running: npm install couchbase and It give the following error: npm ERR! Error: EPERM, mkdir 'C:\Program Files\nodejs\node_modules\couchbase' npm ERR! { [Error: EPERM, mkdir 'C:\Program Files\nodejs\node_modules\couchbase '] npm ERR! errn...
I am planning a web application that I would like to utilize email piping with. I am primarily a PHP developer, but I'm learning MEAN stack development with Node.js and Express to do this project. I have done alot of digging and can't really find any good tutorials or resources to figure out ho...
Sorry, I'm quite new to network programming and nodejs. I'm using nodes in a server with some clients in a local network. Sometimes I have to ask data to clients via get request: // somewhere inside server.js function askDataToClient(ip) { var options = { host: String(ip), ...
I'm programming a game with socket.io drawing in an HTML5 canvas and when the time is over send the image to the node.js server. Is there some way to convert that canvas in an image, send the image in base64 to the node.js app, an finally save it into the server?
Trying to recursively call a synchronous function to parse a element of the array; once the last element of the array is reached the callback is to be called. But the callback is said to be undefined when passed to process.nextTick where as another variable declared in the same scope as the call...
I'm making a testbench with Test'em and Mocha (that run on node.js) in order to test a PHP website. What I want is to request some URL (e.g http://www.my-website/test.php) and get the http status code as well as the content returned. I'm doing it with the node.js Request module. The problem is...
if I use post to upload a file to my nodejs server I get a temp that looks something like this: /tmp/22608-16eior5.jpg by using this: var tmp_path = req.files.postImage.path; My question is, would the name "22608-16eior5.jpg" be unique enough to be used as a unique filename for one folder ...
basically all i want is to send the value of a slider via an UDP stream (in fact there will be several sliders and input fields, which have to gather the data from the slidersettings and then create one big UDP Stream (e.g "$Stream1,Val1,Val2,Val3...") I've looked around and couldnt exactly find ...
In nodejs there is a default timeout for server (incoming http-request) at 120000 (2 minutes) (see: http://nodejs.org/api/http.html#http_server_timeout) But if i do a http-request in nodejs (http.request) in the docs i only find a function (http://nodejs.org/api/http.html#http_request_settimeout...
I have tired of asking google, and honestly would like to hear some sane answer. I got a folder, that has index.js and couple of models (classes) index.js module.exports = { Book : require('./book'), Author : require('./author') } book.js var Author = require('./author') var Book = mode...
I have an app that sends a minimal amount of data to a very large amount of clients at any given time. Even with ten server instances on Modulus I'm getting 100% cpu usage and very high memory usage all the time. How can I minimize my Meteor app's CPU usage? I've read this question, however eve...
Can you get the rest of the path in node.js from reuqested route using express? var url = require("url"); app.get("/path/*", function(req, res) { console.log(req.path); // this will return // '/get/path/to/file' console.log(url.parse(req.path); // this will return // protocol: nul...
How can I perform load/stress tests of my Angular.js application? It is deployed on Node.js invoking rest services from JBoss. I've tried to use Grinder but with no success. I appreciate any suggestions.
I'm using Mongoose in a Node.js application and I want to use inheritance of model. I'm following the instructions given here Inheritance in mongoose and other links but I can't figure out how to make inheritance of statics methods. Here is what I try : // The BaseSchema class : function BaseSc...
I spent some time debugging a strange infinite loop problem in a NodeJS testsuite. It only happens under rare conditions but I can reproduce it when I attach to the chrome debugger. I think it has to do with V8's handling of stack traces in exceptions and a extension that the vows library did to...
I have an array of documents/objects looks like followings: var arr = []; var doc = {}; for (var i = 1; i <= 100; i++) { doc.id = i; arr.push(doc); } arr.forEach(function(doc) { db.docs.save(doc, function() { ... }); }); basically, I create a 1000 objects-array, loop ...
I'm working on a game prototype and worried about the following case: Browser does AJAX to Node.JS, which has to do several MongoDB operations using async.series. What prevents multiple requests at the same time causing the database issues? New events (i.e. db operations) seem like they coul...
I would like to script benchmark of my socket.io implementation. After some research I have identified several NodeJS modules, but they have either not been updated for past years (wsbench), or are only supporting websocket protocol (wsbench, thor) or is not testing socket.io implementation but...
I don't even know if this is possible, I have to bring an RTL version of the website that is LTR.. I'm using Foundation 5 with Node and Grunt.Basically a file that overwrites some css rules of the original ltr file.. The client asked me to; Use a special font-family when the size of the element'...
I'm learning Node / Express. I have set up a simple environment where I would like to load a static html file. The static html file has a link to the jquery CDN. When the static file is loaded and the script tag is executed Google Chrome reports: GET http://127.0.0.1:3000/http//code.jquery.co...
I use Express(3.6.0) + formidable(latest) for upload files to S3. When I submit post , then I always got Error Request Aborted. incoming_form.js: IncomingForm.prototype.parse = function(req, cb) { ....... ....... ....... req .on('aborted', function() { self.emit('aborted'); se...
I'm trying to rewrite a javascript application to coffee script. Though, I can't find how to transform those 2 expressions (I added what I tried beneath). Can you help me please ? var config = require(path.join(__dirname, 'configs'))[env]; (What I tried) : config = require path.join __dirname, '...
I'm building a location-based app that needs to provide users with real-time information about the location of people nearby. I'm looking to avoid building native iOS + Android apps by using a service like Trigger.io to build a hybrid version with Javascript/HTML/CSS that can serve information v...
I'm trying to build some CRUD application with node.js as a back-end API (express) and web-app (backbone) and mobile client (native android) as front-ends. As a node.js beginner (and web programmer in general) I'm trying to understand and find right and simple way to integrate the following grea...
I can not get social share buttons working on Meteor... I add this inside my template <a href="https://twitter.com/share" class="twitter-share-button" data-via="decisionesdificiles" data-lang="es" data-hashtags="dificildecision">Twittear</a> <script>!function(d,s,id){var js,fjs=d.getElementsByTa...
« first day (9 days earlier) ← previous day next day → last day (68 days later) »