Testing new Node.js Framework called Koa.js



In late twenty thirteen, the team behind Express.js announced a new framework called Koa.

Koa is a new web framework which aims to be a smaller, more expressive, and more robust foundation for web applications and APIs. Through leveraging generators Koa allows you to ditch callbacks and greatly increase error-handling. Koa does not bundle any middleware within core, and provides an elegant suite of methods that make writing servers fast and enjoyable.

It uses some features that require an unstable development version of Node.



Let’s try it! First we’ll install node version 0.11.11 Unstable.



wget http://nodejs.org/dist/v0.11.11/node-v0.11.11.tar.gz
tar -xzvf node-v0.11.11.tar.gz
cd node-v0.11.11
apt-get install build-essential
make and make install
node -v

Now we’ll clone an example of Koa.

clone https://github.com/node-modules/koa-ejs.git
cd koa-ejs/example
npm install
node --harmony app.js

Go to localhost:7001 and It works.


In a future article we’ll delve more into this framework.