Hello World!

node.js 2021. 11. 19. 17:18

728x90
const http = require("http");
const port = 3000;

http.createServer((request, response) => {
    response.writeHead(200, { "Content-Type": "text/html" });
    response.end("<h1>Hello World!</h1>");
}).listen(port, () => console.log(`Server running at http://localhost:${port}`));

 

반응형

'node.js' 카테고리의 다른 글

url, query string 모듈  (0) 2021.11.19
Hello World!  (0) 2021.11.19

댓글 0