Middleware is a simple javascript function with three parameters request, response and next Apart from handling http request it can perform the following tasks: Manipulate request and response objects Perform isolated tasks Terminate request flow by sending response Pass the control to another middleware We load middleware...
For building an application with user friendly and consistent UI, we generally use the concept of "master page" and "layouts", so that just the content can vary within the pages. This helps user to easily navigate through the website as well as faster loading of the web pages. For example, generally we make header and footer static...
In our node js application, we can use variety of templating engines like "jade" , "ejs", "mustache" etc. Dust.js is an asynchronous templating engine which can be used both on server side as well as client side and provide easy caching with high performance. In my previous blog on EJS as a templating engine, i have mentioned how we...
Express JS is a very flexible yet powerful framework on top of exponentially growing Node JS Environment. Express makes it really easy to handle requests and how the server interacts with the outside world. It is very simple to get going and it has immense amounts of extremely useful features, Middleware is one of those features of...
In my previous post, I explained how to get started with node.js and executing your first script with node. Now in this tutorial, we will go a step ahead and learn using Expressjs and MongoDB. For people who are new, Express is a web application framework for node which provides a set of features that can be used to build single-page as...