1npm install http then write a webserver...
2const http = require('http');
3const PORT = 3000;
4
5const server = http.createServer((req, res) => {
6 res.statusCode = 200;
7 res.setHeader('Content-Type', 'text/plain');
8 res.end('Hello World');
9});
10
11server.listen(port, () => {
12 console.log(`Server running at PORT:${port}/`);
13});
1Is a child of EventTarget
2Node = DOM objects = Attr, CharacterData (which Text, Comment, and CDATASection are all based on), ProcessingInstruction, DocumentType, Notation, Entity, and EntityReference.
3function isNode(o){
4 return (
5 typeof Node === "object" ? o instanceof Node :
6 o && typeof o === "object" && typeof o.nodeType === "number" && typeof o.nodeName==="string"
7 );
8}