# Node.js 로 http server 구축

* VsCode - Node.js 폴더 안에 Node\_httpServer.js 파일 생성

  ```jsx
  // Node.js로 http server 구축
  const http = require("http");
  http
    .createServer((req, res) => {
      res.write("Hello Node Server");
      res.end();
    })
    .listen(8080);

    console.log("http server를 실행합니다.");
  ```
* node terminal에서 **node** Node\_httpServer.js 실행 ![node.js\_console2](/files/-MaQx9_k8UGDUHbeQaTD)
* <http://localhost:8080>으로 접속해서 http server 생성 확인 ![httpServer](/files/-MaQx9_l6wXCtb0YNDLk)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://yong2401.gitbook.io/til-by-ellie/node.js/node.js_httpserver.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
