Node.js--(1)

Pour apprendre la nouvelle tech qui s'appelle node.js.
un example

var http = require('http');
var server = http.createServer(function(req,res){
    res.writeHead(200,{'Content-Type':'text-plain'});
    res.end('Hello wOrld ');
}).listen(8080);

Donc pour y acceder http://localhost:8080
Ps: il faut utiliser sudo pour un port 80 sous mac.

Comments
Write a Comment