Blog Archives

Jade Tags ?

Tweet Any text at the beginning of a line—by default—is interpreted as an HTML tag. The main advantage of Jade is that this text renders both closing and opening tags for the HTML element, as well as the symbols. Therefore,

Posted in Jade Tagged with:


Tweet we have used existing middleware (body-parser, cookie-parser, static, and connect-session, to name a few), and we’ve even written some of our own (when we check for the presence of &test=1 in the querystring, and our 404 handler). But what

Posted in Express, Node.Js Tagged with: ,

Developing template engines for Express

Tweet To develop template engines for Express ,Use the app.engine(ext, callback) method to create your own template engine. ext refers to the file extension, callback is the template engine function which accepts the location of the file, the options object,

Posted in Express, Node.Js Tagged with: ,

Request Object ?

Tweet The Request Object The request object (which is normally passed to a callback, meaning you can name it whatever you want: it is common to name it req or request) starts its life as an instance of http.IncomingMessage, a

Posted in Express, Node.Js Tagged with: ,

Cluster ?

Tweet A single instance of Node runs in a single thread. To take advantage of multi-core systems the user will sometimes want to launch a cluster of Node processes to handle the load. The cluster module allows you to easily

Posted in Node.Js Tagged with:

Node JS to Deliver HTML Files

Tweet Node JS to Deliver HTML Files: The HTTP module is used to start up HTTP servers and respond to HTTP requests from users. The fs module is used to read the file system.Node js to deliver the html file

Posted in Express, Node.Js Tagged with:

Express JS to Deliver HTML Files

Tweet How to load and “display” a basic HTML file : There are many ways to simply send the html file using the node’s core api of using the readfile,but the easy way to do is using the Express Framework

Posted in Express, Node.Js Tagged with: ,

Callbacks ?

Tweet What is Callbacks : You pass a function reference as a parameter to another function so that it can be executed at a later time function f1(a){ } function f2(b){ var a=10; b(a); } f2 (f1); Here i am

Posted in Javascript, Node.Js Tagged with: ,

Domain Module

Tweet A Node module called domain was introduced in Node 0.8.0 for handling errors. A domain module is like a flexible error handler for any and all errors that might be thrown within it. Using domains is the recommended method

Posted in Node.Js Tagged with:

Try-Catch to catch uncaught errors

Tweet The first thing that comes to the mind about handling uncaught errors is to use the try-catch on operations that are likely to throw a data error. process.nextTick(function() { try { get_data(); } catch(err) { console.log(err); res.send(500, 'Oops!'); }

Posted in Express, Node.Js Tagged with: ,