2017-10-23 10:10
node.js 최신판 5.x를 설치해보도록 하자…
1. $ apt-get install curl
2. $ curl -sL **https://deb.nodesource.com/setup\_5.x** | sudo -E bash -
3. $ apt-get install -y nodejs
4. Hello wolrd 를 작성해보자~
에디터를 열어 아래 내용 작성 이름은 server.js ( 적당한 디렉토리에 )
var http = require(“http”);
http.createServer(function(request, response) {
response.writeHead(200, {“Content-Type”: “text/plain”});
response.write(“Hello World”);
response.end();
}).listen(8888);
5. $ node server.js
6. http://localhost:8888 접속~! Hello world 확인~!