1const http = require("http");
2const port = 4040;
3
4const server = http.createServer((req, res) => {
5 if (req.url === "/") {
6 res.end("hello worrld");
7 } else {
8 res.end("404 not found");
9 }
10});
11server.listen(port, function () {
12 console.log(`http://localhost:${port}`);
13});
14