1. 웹서비스 실행을 위한 스크립트

test2.js 로 아래내용의 스크립트를 생성 후 실행해 본다.

 http.createServer(function(request, response){

    /* 

        HTTP 헤더 전송

        HTTP Status: 200 : OK

        Content Type: text/plain

    */

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

    

    /*

        Response Body   "Hello World!!!"

    */

    response.end("Hello World!!!\n");

}).listen(8081);


pc에 node.js만 설치하고 바로 익스플로러를 통해 결과를 확인 가능했다.


2. node test2.js 를 실행해 아래 결과를 확인한다.


3. 익스플로러에서 http://127.0.0.1:80을 실행해본다.

아래 결과가 나오면 정상

#nodejs 설치 버전확인 방법

C:\Users\Administrator>node --version

v8.12.0



+ Recent posts