책 따라 하면서 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개
9년 전
Hello world 처음 찍어내는 그 기쁨입니다.
게시판 목록
Node.js
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 55 | 3년 전 | 818 | ||
| 54 | 3년 전 | 897 | ||
| 53 | 3년 전 | 1288 | ||
| 52 | 4년 전 | 1211 | ||
| 51 | 4년 전 | 3281 | ||
| 50 | 4년 전 | 3941 | ||
| 49 | 4년 전 | 2795 | ||
| 48 | 4년 전 | 1512 | ||
| 47 | 4년 전 | 1101 | ||
| 46 | 4년 전 | 1545 | ||
| 45 | 4년 전 | 1699 | ||
| 44 | 5년 전 | 1238 | ||
| 43 | 5년 전 | 1545 | ||
| 42 |
|
5년 전 | 3208 | |
| 41 | 6년 전 | 2483 | ||
| 40 | 6년 전 | 1614 | ||
| 39 | 6년 전 | 1629 | ||
| 38 | 6년 전 | 1465 | ||
| 37 | 6년 전 | 1672 | ||
| 36 | 6년 전 | 2522 | ||
| 35 | 6년 전 | 2199 | ||
| 34 | 6년 전 | 1877 | ||
| 33 | 8년 전 | 2264 | ||
| 32 | 8년 전 | 1965 | ||
| 31 | 8년 전 | 2955 | ||
| 30 |
|
8년 전 | 4357 | |
| 29 |
프로그래머7
|
8년 전 | 1907 | |
| 28 | 8년 전 | 2219 | ||
| 27 |
|
8년 전 | 2362 | |
| 26 |
|
9년 전 | 3069 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기