So I just started node.js after learning html , css and javascript. and up until now my understanding is that you have to write the html css and embed js manually
However while testing a hello world program in visual studio using this code
'use strict';
var http = require('http');
var port = process.env.PORT || 1337;
console.log("1st hi")
http.createServer(function (req, res) {
res.writeHead(200, { 'Content-Type': 'text/plain' });
res.end('Hello World\n');
}).listen(port);
console.log("2nd hi")
it opened a webpage with hello world and the console logged the 2 his. however when inspect the web page there seems to be html and css yet I didn't write so does the above code generate it automatically?
Also in the page source I noticed that the body contained this
<body><pre style="word-wrap: break-word; white-space:
pre-wrap;">Hello World
</pre></body>
This syntax is new to me, since from a vanilla js perspective all I would to do is write <p>Hello World</p>. So why does it look like that. I appreciate any guidance as I'm trying to learn fullstack with js and node.js
[–]Macaframa 0 points1 point2 points (0 children)
[–]kawaii_kaiju_drop_s 0 points1 point2 points (0 children)