I´m in the process of migrating a play framework application to node.js, express and ejs, I would like to emulate somehow moreStyles and moreScripts, I´ve tried something like this, without success: layout.ejs <body> <%- body %> </body> <%- moreScripts() %> index.ejs <% layout('layout') -%> <...
im writing a local file streaming over airplay protocol with subtitle support, to do that im using ffmpeg and the process works really fine, but the main problem is when try to start streaming after burning the subtitle, the airplay doesn't work, but when i comment the lines that do the burning w...
code as follows: var mysql = require('mysql'); var connection = mysql.createConnection({ host : 'localhost', port :"3306", database :"mydb", user : 'root', password : '007007', }); var isCon = true; connection.connect( function (err) { console.log(isC...
So my partner and I are working on a mobile app which requires registration, thus sending registration information back to a web service we have written in Node.js to handle the registration information and store it in MongoDB. This is (we believe) standard protocol, except recently we have a dif...
I'm using https://github.com/einaros/ws, i can't use Socket.io because i'm working with an IDE(drag and drop) and it uses native WebSocket(on client side) so no websocket wrappers are allowed (on server side).. My needs as the follow(basically same as Socket.io): 1) Clients Makes/join/leave ro...
I'm a front-end dev just venturing into the Node.js, particularly in using it to create small command line tools. My question: how do you persist data with command line tools? For example, if I want to keep track of the size of certain files over time, I'd need to keep a running record of chang...
I am in the process of converting a Marionette app from code which is all enclosed in Marionette modules to node js module exports so that I can use node and browserify in my project. However when it comes to my 'Entities' module I am struggling to come up with the correct solution of how to hand...
I'm using IRC npm and my bot hasn't been connecting to an IRC server and I wasn't receiving any errors. So I went into the source code to find out what was happening. Apparently the function was ran. Where is it being emitted? And I found this: util.log('Connection got "close" event'); W...
I know this question may seem stupid but I've been googling and asking this question for a while since I decided to start learning node.js. Ok so I have a hosted web server over at X10Hosting (https://www.x10hosting.com/) and I'm wondering how I could host a simple node.js web app on it. Thanks, ...
I'm trying to install node.js package with npm but it's giving me that error. Error: ENOENT, stat 'C:\Users\Zain\AppData\Roaming\npm
For example, I have a controller to show user a list view, some columns need data comes from another endpoint, so I wrote these with intuition, could you tell me how do I re-factory them? $http.get($scope.urlA) .success(function(res){ $scope.dataA = res.data; $http.get($scope.urlB) ...
What is the difference between these two with and without almond? require('module'); require(['module']); former gives a requirejs error (that suggests to use the ladder). The reason i am asking is, I am studying example-libglobal on how to build a lib that can be used as an AMD module. The ...
I would like to seek help on displaying mySQL records in node.js Jade. I have followed the basic tutorial of node.js Jade and able to get it work by displaying default index.jade but when I start to implement mySQL connection link and function in my index.js, it display none and shows no data rec...
I am working on a MEAN & Socket.io project where Mongodb in the back-end holds my data and I am using socket.io to publish newly arrived data to all the clients. To make it real time, I am using Mongodb capped collection to send newly arrived data (Insert) to all the clients using socket.io emit....
I'm a newbie in node js and trying to build a simple app to build web pages from RSS feeds. http.get('http://www.someurl.com/news?output=rss', function(res) { res.on('data', function(chunk) { resLength += chunk.length; chunks.push(chunk); }); res.on('end', function(c...
Hi I'm trying to install nodejs in a Pengwyn board (TI Sitara AM3354 ARM) after installing Yocto Linux successfully. I don't know how to install node inside. I've tried opkg but it shows this error in the MiniCom: opkg_install_cmd: Cannot install package <Packag name's> I'm a bit frustrated a...
I do the following : //Node.js server file (app.js) render(index, {json:{string:"Test GmbH\nTheater-, Konzert- und test\ntße 20 \n51065 Köln\n\nTelefon: test \ntest: test\n\ntest: [email protected] "}}) //Template to render (index.ejs) var data = <%=JSON.stringify(json)%>; So that I can ...
I'm trying to install zeroRPC on my raspberry pi, because i need to make python and node.js programs talk together. I followed this guide for the installation of the environment: http://ianhinsdale.com/code/2013/12/08/communicating-between-nodejs-and-python/ and everything installed successfull...
How can i override a mixin but still keep the old mixin functionality. I have a mixin that uses beforeModel, and have a route: App.PlayRoute = Ember.Route.extend("beforeModelMixin", { beforeModel: { // Here i want to have mixin beforeModel functionality as well as my own hook. }...
I've a setup of apache (usbwebserver) and nodejs (both latest versions). I changed the httpd.conf (as described here http://stackoverflow.com/a/18604082/1112413) HTTPD.CONF ProxyPass /node http://localhost:8000/ APP.JS Current Code: var app = require('express')(); var http = require('http'...
I would like to seek help on my LED Switch REST API. I have created my own REST API and able to light up my LED when I type in the URL for example: localhost:3030/7/1 to light on and localhost:3030/7/0 to light off. But when I start to implement a switch to manually on and off my LED without keyi...
I have a project and installed for example underscore and marked via npm install. When I launch node in my project root folder, I can require both with var __ = require("underscore"), similar for marked. This is how I use both libraries in my backend, if needed. Now I want to write a myscript.js ...
What type of apps are good to build with a mean stack. What are the advantages of a nosql database? Any useful suggestion would be greatly appreciated, as I am considering learning node js.
I am a novice programmer in Node JS. I have a few queries regarding process related issues like locking and race conditions in Node JS and Mongo DB. My codes are working perfectly in local environment,but when I am moving to production and come across large number of requests,I might encounter c...
FBFriendModel.find({ id:333 },function(err,docs){ docs.remove(); //Remove all the documents that match! }); The above doesn't seem to work. The records are still there. Can someone fix? Thanks.
I'm experimenting with node.js / socket.io and came across some strange things when connecting and disconnecting to the socket.io server. Socket.io version 1.0.6 Node.js version 0.10.29 Express version 4.7.2 I'm storing my connections to a JavaScript object/array that I declared at the top of a...
I am trying to access HBase on Microsoft's Azure from Node.js. I looked at different libraries such as bhase and also the REST API (webhcat). What I want to achieve is to create a table and and upload data from Node. Later I want to do queries on this dataset. Unfortunately the documentation from...
Sorry for the awkward post title but it's a very weird situation to be in. In my project I have a folder structure like so: /filters index.js [...] /controllers index.js [...] app.js app.js is basically the entry point of my application and I thought it would be cool if I c...
I am trying to do a per-day aggregation in MongoDB. I already have an aggregation where I successfully group the data by day. However, I want to do the aggregation in such a way where days with no data show up, but empty. That is, they are empty bins. Below is what I have so far. I have not been...
Let's say I have some sort of game. I have a buyItem function like this: buyItem: function (req, res) { // query the users balance // deduct user balance // buy the item } If I spam that route until the user balance is deducted (the 2nd query) the user's balance is still positive. ...
Let me explain: I am building a node.js project that needs to check if dates match or fall within a range. If there is a match, I need to store a reference to the path of a file on the server. There are about 80 of these files. They are configurations. I can write a giant condition in a function...
I'd like to create a system where there are maybe 4-5 types of user groups that can access certain things. The higher the permissions, the more they can do. That's simple to make for me, but the hard part for me is to create the system where the higher ranks can do anything lower ranks can, but l...
I managed to setup nodeclipse with nodemon and I can now start my server.js script with monitor (nodemon) but something strance occurs: On file change (even on the server.js) nodemon wont restart In nodeclipse console I dont see the normal nodemon output, ex: 1 Aug 15:20:05 - [nodemon] v1.2....
It takes me ~1.5 mins for my jaspersoft reports/dashboards to load - is there anyway I can speed it up ? I use Jaspersoft Studio 5.6 to create dashboards / reports out of data sitting in a private cloud (connection using VPN). The private cloud has 2 nodes (name node, storage node). use the stor...
I want to create helpers ... like function linkTo (value, href, options) { ..... } But I want this to be global, so I can use to put the links at my views files, <%= linkTo('link','/controller/action') %> Instead of <a href="/controller/action"> Link </a> Should I use a service?
My API endpoint fetches some data from DB and returns to user (2.8KB gziped). I load tested this endpoint with 50 concurent connections per each second (loader.io, app hosted on heroku, build with node.js) and avg time was ~1300ms. Is it normal, slow, very slow? I know that it depends on DB quer...
I've recently changed my openshift default domain myapp.rhcloud.com in www.myapp.com with a custom ssl certificate. The config works perfectly well until the web page ask the server for a websocket connection. I use node with socket.io and websockets enabled I first tried: io.connect(https://ww...
I might be out of depth but I really need something to work. I think a write/read stream will solve both my issues but I dont quite understand the syntax or whats required for it to work. I read the stream handbook and thought i understood some of the basics but when I try to apply it to my situa...
I'm using the Poet module in an Express app. Poet don't support Expresss 4 yet, but a patch exist, a change in the module code. I applied that patch, and my app is working locally. But Heroku load the original version of the package, without patch. How can I apply the change to my heroku app ?
I want to include my linkchecker test into grunt. I can execute it just fine with powershell & 'C:\Program Files (x86)\LinkChecker\linkchecker.exe' http://localhost:3000 This is my Gruntfile: Sorry about the screenshot, but SO thinks my code is not properly formated when I paste it in here....
Is there a recommended pattern for page elements that are persistent and common across all pages on a site? For instance, a "total units sold" on the top of every page. You would cache that value and update the cache every hour or so, but where would you actually retrieve this value and pass it t...
I am not sure why my grunt-watch is not running for the JS or CSS configurations Here is my CSS folder structure: -css --src ---styles.css ---third-party ----bootstrap.css Here is my JS folder structure: -js --src ---app.js ---third-party ----jquery.js Here is my package.json { "name": "m...
I'm trying to use Swig template for Nodejs in the browser. The requirement: I need to use custom filters in my precompiled templates with Swig CLI. The issue: The result of my compilation doesn't have the custom filters functions and I get the an error. The steps I've made 1- Compile the te...
I'm building a simple messaging server and it works perfect using the socket.broadcast.emit() however if you use the socket.boradcast.in(room).emit() it dose not connect up. I've include the server code and client code below. server var app = require('express')(); var http = require('http').Ser...
I am getting different results for different gulp.watch instruction When I execute my watch task and change an .html file, everything works correctly (tasks defined below) But when I change any other files (.coffee, .less, etc) I get this error: stream.js:94 throw er; // Unhandled strea...
I have been working on something using AJAX that sometimes requires a couple POST's per second. Each post returns a JSON object (generated by the PHP file being posted to, ~11,000 bytes) and on average the latency is between 30ms and 250ms depending on if i'm on wifi or wired, but every roughly 1...
I'm trying to stream a large video file to the browser in a <video> tag using websockets. The video plays fine, but it always waits until it's downloaded the entire video before playing, resulting in a large delay. Setting autoplay = true and preload="none" seems to have no effect on this. So I...
NodeJS version: v0.10.29 Mongo version: 2.6.3 NodeJS mongodb module: 1.4.5 We are getting the following error in the callback to db.open "Error: No valid replicaset instance servers found" The mongodb seems to be working fine and there is no error in the mongodb logs. Restarting the nodejs se...
I created an XML string with the following code: $xmlstr = <<<XML <?xml version='1.0' standalone='yes'?> <product_list> </product_list> XML; Then I included this php file into another php page, and work with the addChild() to insert a new node. include 'xml.php'; $product = new SimpleXMLEleme...
Mac OS X 10.9.4, Node v0.10.30, npm 1.4.21, grunt 0.4.5, grunt-rsync-2 0.1.3 When I run an rsync-2 task with grunt, I see the error: rsync: failed to set permissions on "<path info>": Operation not permitted (1) rsync error: some files/attrs were not transferred (see previous errors) (code 23) ...
I am using jade with express. In jade i want to inline css for production and link it for development mode, as shown below - if(environment === 'development') { link(rel="stylesheet", href='styles/style.css') - } else { style(type="text/css") ...
I currently have a HTTPS web server listening on port 443 on my host machine. My goal is to set up another HTTPS web server on the same host machine, change ports on both web servers, and then set up a proxy server using node-http-proxy listening on port 443 instead. The proxy server then deleg...
Ok so I am working on this idea to make a socket service to a server that exposes a older DB via JDBC. The idea is to have the client pass a SQL string on the socket and get back the data ion JSON. Kinda of a poor man's database driver. Queries that return large amount of data are sent in chun...
Im trying to follow the instructions from http://www.telesc.pe/docs/installing-telescope/ Managed to install node.js and npm using the link on the page. I have also installed meteor and meteorite. I have also pulled the latest uddate using git clone [email protected]:TelescopeJS/Telescope.git I can ...
While building a NNTP client in NodeJS, I have encountered the following problem. When calling the XZVER command, the first data I receive from the socket connection contains both a string and an inflated string; 224 compressed data follows (zlib version 1.2.3.3) ^*�u�@����`*�Ti���d���x�;i�R��ɵ...
I'm trying to build a zip archive with a node.js server that used adm-zip to compress all the files. Server uploads an .svg file, and try to send a response to the user with a .zip archive composed of .ttf, .woff & .eot files (looks like what Fontsquirrel's webkits do). The problem is that somet...
I have a NodeJS server running on Express. I am using MongoSkin to connect my web server to MongoDB. I have the following route: var express = require('express'); var router = express.Router(); router.post('/add', function(req, res){ var db = req.db; db.collection('products').insert(r...
I'm going thru a weird issue and I don't know where to look to find the problem. For web projects I use this architecture (Ubuntu Server, by the way): Nginx as reverse-proxy / load-balancer Supervisord to manage workers gunicorn (in case of Python/PostgreSQL projects-TG2, Pyramid, etc) / NodeJ...
I would like to write an application using Node.js. The purpose of application is to download the file specified in URL, by giving the URL parameter. For instance, I would like to download .png file in URL http://i.cdn.turner.com/cnn/.e/img/3.0/global/header/intl/CNNi_Logo_new.png. I can write th...
Ok so i've been using this as a guide and i've got my app working despite not having the exact same code. I can go to /auth/twitter and it will authenticate via twitter and return to the /profile url which I guess means it's worked. It also created the database object so i'm guessing that worke...
In my node.js / Express.js app, I need to pass parameters with the socket.io connection (saw that in another post). On client side, I have something like : var socket = io.connect('/my/namespace', {query:"param:value"}); On server side : io.of('/my/namespace') .on('connection', function ...
My web application receives from untrusted user some unfiltered string, and then has to determine, if this string, when used as hostname, somehow resolves to IPv4 or IPv6 address in forbidden range, determined by set of predefined rules. So, in case string appears to be IPv4 or IPv6 address (eit...
I'm having a really hard time trying to get some node modules to install on various platforms, including: Windows 7; Windows 8.1; and Windows 2008 Server. For example, if I try to run "npm install bson", on some machines the install works perfectly, but on other machines I get various arcane ...
I have a node.js server with restify. I want to send it a get request that has an array of names in it. I think the request should look like this (but I am not sure about it): /users?names=bob,joe,michael,joey Is this query correct? How do I get the names I send on the node.js server?
I have an Express NodeJS server that I manually start through terminal with npm start in my project root folder. I downloaded and installed the Forever package globally. When I run Forever against my app.js file using: forever start app.js my server doesn't start. I am assuming this is beca...
This is what our app looks like when starting: => Started proxy. => Started MongoDB. >>>>> IN ON_TEST meteor-collection-management: updating npm dependencies -- mongodb... Argh. In meteor-collection-management/package.js (our own package), there is this: Package.on_test(function(api) { ...
I'm building a socket based server. It does not need websockets as it's not talking to web clients. I would like the server to be clusterable and that means not all sockets are on a single server. I know socket.io handles this with redis and a pub/sub system. I'm wondering if such a library exist...
I have an issue where vagrant forwards port 3000 and Docker/express use 3000 as well. When I add the follow to my Gruntfile, It's obviously using the same port and won't run. (port already in use error) options: { livereload: 3000, hostname: 'localhost' }...
I am new in node js.I want to print helo in node js.For print helo,which editor is use?how run node js?plese give me some any basic idea node js.I had installed node js and github.Just type cosole.log('helo'); on github and enter key presssed get helo in github.How create js file node js?how run ...
I created a Middleware to get rid of my page request but it seems to run twice... The first time it run has no error and second time has errors... This is my code: app.js file app.get('/:slug', buildingController.findBuilding, buildingController.getBuilding); buildings.js file /** * Creat...
How I can invoke node package manager from Sublime Text 2? I would like to install/uninstall packages from Sublime.
I wish to try out Grunt so for a task I have duplicated a project and want to convert it from using the default asset pipeline to work all via Grunt and it's tasks. I can then evaluate both approaches and go for what I think turns out the best. I have disabled the pipeline in my application.rb ...
When I deploy my site to Heroku, the JPG's are greatly compressed. For example, a JPG which should display as about 72k is showing up as 14k. I am utilizing the imagemin grunt plugin to compress the image on deploy, however it compresses the image only slightly (original is about 84kb and it com...
I have a complex node/express app that runs fine locally and on server. When we clone the project on another laptop, we are getting the http.js header error: http.js:689 throw new Error('Can\'t set headers after they are sent.'); I've been through all the answers here and been through the cod...
I'm trying to find a suitable Node.js method of recreating the functionality found here: https://github.com/fastly/token-functions Specifically, I'm getting hung up on the "pack()" function (I believe, could be my crypto function?) found across the various languages in the library. Here is my cu...
I'm trying to sudo for a node install: sudo npm install -g grunt sudo npm install -g grunt-cli sudo npm install -g bower The commands error stating to run as an administrative user. How do I do that in the Dockerfile? RUN npm install -g grunt #RUN ln -s /home/dev/spikes/node-esjs-master...
I'm completely new to using Node.js and even utilizing the command line, so this question may be extremely elementary, but I am unable to find a solution. I am trying to set up an app directory using Node.js and NPM. For some reason, whenever I try to use the port:5000 I get a "Cannot GET/" erro...
I'm trying to write a Node script that makes use of the NPM API. The script works, but requires admin access for certain modules to be installed. I tried running the script with sudo, but it fails on the line requiring NPM. I distilled it to the following simple script: var npm = require('npm'...
How can I have Synchronous calls in two nested 'for' loops in Node.JS: Here is my Asynchronous call; I don't know how I can have synchronous version of my code, which goes to next iteration when create_db is done! var new_items = []; for (var key in config.models) { var selected_...
I'm new at Stylus, installed nodejs and stylus and all is ok except when I try to convert a .CSS file to .styl with > "stylus -C filename.css" (also tried with --css) on terminal at file folder, I'm working on kubuntu 14.04 , I'd appreciate any help, oh, I also installed all the libraries I coul...
Been playing around with a node webapp and I don't understand these two terms well. My previous experience is mainly with iOS front-end dev. I'm assuming a node instance is an instantiation of a node object, correct? If that's correct then I understand the concept well. As for a process, I don'...
I am using Gulp to develop an Angular application generated by Yeoman's gulp-angular generator. I have configured it to proxy requests to /api to another port, the port my API is listening on. That port is actually forwarded via an SSH tunnel to an external server. Here is the config generated b...
« first day (76 days earlier) ← previous day last day (1 day later) »