We need an example of a simple project that implements a server on node JS.
- stackoverflow.com/questions/2353818/… there is just an exhaustive number of links to information about the node - Denis Epishkin
|
1 answer
const http = require('http'); http.createServer((req, res)=>{ // 1. Tell the browser everything is OK (Status code 200), and the data is in plain text. res.writeHead(200, { 'Content-Type': 'text/plain' }); // 2. Send the announced text (the body of the page) res.end('Hello, World!\n'); }).listen(1337); But the text on the first link, which answers the question, is nowhere easier, it seems to me.
|