Download Node.js setup from http://nodejs.org/# and install it.
- Type up the following hello.js in your favorite editor
var http = require('http'); http.createServer(function (request, response) { response.writeHead(200, {'Content-Type': 'text/plain'}); response.end('Hello World\n'); }).listen(8080); console.log('Server running at http://127.0.0.1:8080/');
- Run
node hello.js
- You’ll see Hello World printed when you visit http://localhost:8080
No comments:
Post a Comment