The Node.js Server Platform, Icons, 3D and the Future

So, still wanting to write some web application code, are we?

Since yesterday, we have a suitable editor in place.

Another helpful component is a web server.

Node.js is an open source, cross-platform JavaScript runtime environment for server-side and networking applications, providing an event-driven architecture and a non-blocking I/O API that optimizes throughput and scalability for real-time web applications.

We can use that to build a web server.

This simple web server written in Node and highlighted on the node.js home page responds with "Hello World" for every request:

  var http = require('http');

  http.createServer(function (req, res) {
    res.writeHead(200, {'Content-Type': 'text/plain'});
    res.end('Hello World\n');
  }).listen(1337, '127.0.0.1');

  console.log('Server running at http://127.0.0.1:1337/');

To run the server, put the code into a file example.js and execute it with the node program from the command line:

  % node example.js
  Server running at http://127.0.0.1:1337/

Furthermore, happily, our Brackets editor provides built-in support for running node.js.

To learn Node, tutorials and workshops are provided by the worldwide decentralized, open source and volunteer run NodeSchool organisation.

I installed the NodeSchool learnyounode 'workshopper' tutorial like this:

  $ npm install -g learnyounode

Actually, I had to run it in sudo to obtain write access to /usr/local/lib/.

Note that the NodeSchool workshoppers also include an intro to WebGL to get started with three.js and WebGL:

  $ npm install -g introtowebgl

Talking about WebGL, here is an important related event you don't want to miss:

The 3D Web Fest

I already pointed out the upcoming 3D Web Festival celebrating the web transition from mostly text to 2D image rich and now shifting to 3D:

Open to any and all creative human beings, it will showcase 3D web sites presenting mixtures of music, art and technology, bringing together the best of the 3D Web – presented as Live Performance Art – amazing, delightful, surprising and at times disturbing, including creations by artists and developers of all kinds live with musical accompaniment.

Time and place is Wednesday May 13th from 7 to 10 pm at the Folsom Street Foundry in San Francisco, with ticket proceeds going to the Roxie, a community-based, non-profit theatre.

You can submit your application here.

A History of the Future in 100 Objects

Here is another nice example of modern art, this time literary in nature, addressing technological trends, science fiction, humanity and philosophy:

A History of the Future in 100 Objects by Adrian Hon:

"Why write a history of the 21st century?   There are still 18 years until the end of the century, and it may seem foolhardy for a mere human to attempt to analyse the data at our disposal...   The 21st century is different: it represents the first time in our history that we have truly had to question what it means to be human. It is the stories of our collective humanity that I hope to tell through the hundred objects in this book."

The 3D Web Coder Favicon

As you may have noticed, I set up a Favicon for this site.

To do so, I created thumbnail images of the author image in various sizes, copied them all into one single ICO file using Visual Studio, and placed that in the root folder of the blog.

Here are the five thumbnails and the favicon.ico file with their sizes in bytes:

    1406 favicon16.ico
    3262 favicon32.ico
    7358 favicon48.ico
   12862 favicon64.ico
   24350 favicon88.ico
   49214 favicon.ico