Merge pull request #1302 from jihdeh/patch-1
Update nodeJS code to supported es6 version LTS
This commit is contained in:
commit
ce5a76ec12
|
@ -59,13 +59,13 @@ The first step is to write the application. Save this code in a folder called "`
|
||||||
#### server.js
|
#### server.js
|
||||||
|
|
||||||
```javascript
|
```javascript
|
||||||
var http = require('http');
|
const http = require('http');
|
||||||
var handleRequest = function(request, response) {
|
const handleRequest = (request, response) => {
|
||||||
console.log('Received request for URL: ' + request.url);
|
console.log('Received request for URL: ' + request.url);
|
||||||
response.writeHead(200);
|
response.writeHead(200);
|
||||||
response.end('Hello World!');
|
response.end('Hello World!');
|
||||||
};
|
};
|
||||||
var www = http.createServer(handleRequest);
|
const www = http.createServer(handleRequest);
|
||||||
www.listen(8080);
|
www.listen(8080);
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -88,7 +88,7 @@ Next, create a file, also within `hellonode/` named `Dockerfile`. A Dockerfile d
|
||||||
#### Dockerfile
|
#### Dockerfile
|
||||||
|
|
||||||
```conf
|
```conf
|
||||||
FROM node:4.4
|
FROM node:4.5
|
||||||
EXPOSE 8080
|
EXPOSE 8080
|
||||||
COPY server.js .
|
COPY server.js .
|
||||||
CMD node server.js
|
CMD node server.js
|
||||||
|
|
Loading…
Reference in New Issue