The purpose
The following article launched an HTTP server using Node.js.
I read that using Node.js on a Unix-like OS prevents it from starting on port 80.
However, the article didn’t specify whether port 80 is usable on Windows. Intrigued, I decided to try it myself.
Environment
Node.js v20.16.0
tried code
I used the following code.
I only changed the port in the article above.
import http from 'node:http';
const server = http.createServer((req, res) => {
res.writeHead(200, { 'Content-Type': 'application/json' });
res.end(JSON.stringify({
data: 'Hello World!',
}));
});
server.listen(80);////use Poet 80
Result

We are able to access it from Chrome on 127.0.0.1 (without specifying a port) This is just a record, as there’s no special know-how involved.
comment