Express for Node.js

Express is a simple web application framework for building hybrid web applications. You can render web pages, generate  customized responses and create user-friendly APIs quickly with ease. It just fits the trade with Node.js. This post covers the installation and hello world example: Installation: buntu@ubuntu:~$ sudo npm install express express@3.1.0 node_modules/express ├── methods@0.0.1 ├── fresh@0.1.0 …

Continue reading Express for Node.js

Tornado – Autoreload

One of the most irritating (i would say) things about web development is about restarting your web server whenever there's a change in the code base or the template files to test if the development change has been propagated correctly... If you're a web developer you know exactly about the agony I'm referring to... Well, …

Continue reading Tornado – Autoreload

Tornado – Internationalization

  Web development often calls for internationalization (i18n), Tornado provides this facility with tornado.locale class. In the example below, we create request handlers to cater to users request for different locale. For instance, DEHandler renders a standard web page (locale_template.html) in German language after translating the English words from the template. https://gist.github.com/3402066 Translation is governed …

Continue reading Tornado – Internationalization

Tornado – Cookies

Cookies are used by web developers or designers to store data on the client side. When user submits some information to the server, the server takes a decision based on posted data and redirects the user to relevant page. But when user browses to all together a different page, this information is lost. Cookies help …

Continue reading Tornado – Cookies

Tornado – Error Handling

Web development often calls for gracefully handling of non-existent pages or broken links that users request for. A simple way to achieve error handling in Tornado is with: tornado.web.HTTPError - Exception handler that can used to generate error code of specified type. It is often used to raise an exception as we would see in …

Continue reading Tornado – Error Handling

Tornado – Templates – Run time and Cached

Website development often calls for reuse of pages. For instance, when you open your Citibank account after login the welcome page you see is same what other bank customers see but its customized with your name and settings. Do you think Citi creates so many web pages for all its customers? Well, they use, what's …

Continue reading Tornado – Templates – Run time and Cached