Skip to content

Commit

Permalink
Merge pull request #381 from Chris911/maintenance/about-page-code-sample
Browse files Browse the repository at this point in the history
Update code sample on about page with ES6 features
  • Loading branch information
phillipj committed Nov 27, 2015
2 parents 8160c6a + 7eb2b1b commit bac5516
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions locale/en/about/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,17 @@ connections can be handled concurrently. Upon each connection the callback is
fired, but if there is no work to be done Node is sleeping.

```javascript
var http = require('http');
const 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');
const hostname = '127.0.0.1';
const post = 1337;

console.log('Server running at http://127.0.0.1:1337/');
http.createServer((req, res) => {
res.writeHead(200, { 'Content-Type': 'text/plain' });
res.end('Hello World\n');
}).listen(post, hostname, () => {
console.log(`Server running at http://${hostname}:${post}/`);
});
```

This is in contrast to today's more common concurrency model where OS threads
Expand Down

0 comments on commit bac5516

Please sign in to comment.