In Molokoloco | 12 Jul 2010 | Laisser un commentaire
Node.js is a javascript Framework that runs server side, it is built on the V8 engine
An example of a web server written in Node which 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(8124, "127.0.0.1"); console.log('Server running at http://127.0.0.1:8124/');
API documentation : http://nodejs.org/api.html
Download : http://github.com/ry/node
http://paul-m-jones.com/blog/?p=236, PHP Helloworld :
Concurrency Level: 100 Time taken for tests: 9.623 seconds Complete requests: 10000 Requests per second: 1039.13 [#/sec] (mean) Time per request: 96.234 [ms] (mean) Time per request: 0.962 [ms] (mean, across all concurrent requests)
Helloworld with node.js :
Concurrency Level: 100 Time taken for tests: 2.735 seconds Complete requests: 10000 Requests per second: 3656.96 [#/sec] (mean) Time per request: 27.345 [ms] (mean) Time per request: 0.273 [ms] (mean, across all concurrent requests)
Futher reading..
MyBookReadR | The RSS Wall | Carousel slider | Fast web start | Try it :)
My latest sources and sheets :
Github sources | Personnal wiki | jsFiddle example | WebDev bookmark