리자

책 따라 하면서 web server 구동 성공했네요.

server.js 

-------------------------------------------------------

var http = require('http'); 

http.createServer( function(request, response) {

  response.writeHead(200, {'Content-Type': 'text/html'});

  response.end('<h1>Hello Web Server with Node.js</h1>');

}).listen(8080, function() {

  console.log('Server running at :8080');

});




$ node server.js 실행
Server running at :8080



// 8080 포트 풀고
# iptables -I INPUT -p tcp --dport 8080 -j ACCEPT 



// 브라우저에서 실행하니

Hello Web Server with Node.js



나오네요. ^^
|

댓글 1개

Hello world 처음 찍어내는 그 기쁨입니다.
댓글을 작성하시려면 로그인이 필요합니다.

자유게시판

203,305건
+
제목 글쓴이 날짜 조회
15-12-17 조회 1,408
15-12-17 조회 1,426
15-12-17 조회 1,394
15-12-17 조회 1,595
15-12-17 조회 1,862
15-12-17 조회 1,523
15-12-17 조회 1,474
15-12-17 조회 1,411
15-12-17 조회 1,373
15-12-17 조회 1,371
15-12-17 조회 1,345
15-12-17 조회 1,951
15-12-17 조회 1,329
15-12-17 조회 1,450
15-12-17 조회 1,675
15-12-17 조회 1,339
15-12-17 조회 1,393
15-12-16 조회 1,469
15-12-16 조회 1,283
15-12-16 조회 1,432