Skip to content

Commit

Permalink
Added Getting Started guide (#1308)
Browse files Browse the repository at this point in the history
  • Loading branch information
jevtovich authored and fhemberger committed Jul 28, 2017
1 parent f31591c commit 88e9f60
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions locale/en/docs/guides/getting-started-guide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
title: Getting Started Guide
layout: docs.hbs
---

# How do I start with Node.js after I installed it?

Once you have installed Node, let's try building our first web server\
Create a file named "app.js", and paste the following code:

```javascript
const http = require('http');

const hostname = '127.0.0.1';
const port = 3000;

const server = http.createServer((req, res) => {
res.statusCode = 200;
res.setHeader('Content-Type', 'text/plain');
res.end('Hello World\n');
});

server.listen(port, hostname, () => {
console.log(`Server running at http://${hostname}:${port}/`);
});
```

After that, run your web server using ``` node app.js ```, visit http://localhost:3000, and you will see a message 'Hello World'

0 comments on commit 88e9f60

Please sign in to comment.