Skip to content

Commit 53bf546

Browse files
committed
tested node js in VSCode
1 parent 8f3d6cf commit 53bf546

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

index.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
const http = require("node:http");
2+
3+
const hostname = "127.0.0.1";
4+
const port = 3000;
5+
6+
const server = http.createServer((req, res) => {
7+
res.statusCode = 200;
8+
res.setHeader("Content-Type", "text/plain");
9+
res.end("Hello, World!\n");
10+
});
11+
12+
server.listen(port, hostname, () => {
13+
console.log(`Server running at http://${hostname}:${port}/`);
14+
});

0 commit comments

Comments
 (0)