Tag Info

New answers tagged

0

I have decided to re-implement the solution using Node Streams, rather than simple events, allowing me to use pipe().


-1

Actually you can run node.js on a typical shared hosting with Linux, Apache and PHP. Even NPM, Express and Grunt work fine. Here are the necessary steps: 1) Create a new PHP file on the server with the following contents and run it: <?php //Download and extract the latest node exec('curl http://nodejs.org/dist/latest/node-v0.10.33-linux-x86.tar.gz | ...


1

The traditional web server port is 80. However, this is a port in the privileged area on many systems (requiring the administrator of the machine to run the program that listens to that port). This rules out 80 and 800 as options for ports to set up a server on. The next value in that series would be 8000. Many web servers are configured to listen on ...


2

I created a module that generate class diagram for javascript/node/html/css. Its based on the "WAE" extension of UML. Its called wavi. For javascript, function,variable and use of other modules are automatically recognized. You can use it for documenting your application. https://www.npmjs.org/package/wavi


2

Both solutions can make sense. Using functions as parameters is useful in many cases, and this generally makes it easier to write correct code because you're forced to provide callbacks for all circumstances. However, an API that requires callbacks tend to create unnecessarily deep indentation. This becomes more obvious when we have more than one validation, ...


2

Wouldn't it be simpler to pass the callback to connection.query around? // model function listCountries(limit, offset, callback) { // SQL is just an example connection.query('SELECT * FROM countries LIMIT 1', callback); } // controller var Country = require('./country.model'); exports.index = function(req, res) { var limit, offset; ...



Top 50 recent answers are included