I am running a nodejs server file, code below. Currently the code you see does not have the HTML or CSS referenced because I don’t know how to do it.
const http = require('http');
// Create an instance of the http server to handle HTTP requests
let app = http.createServer((req, res) => {
// Set a response type of plain text for the response
res.writeHead(200, {'Content-Type': 'text/plain'});
// Send back a response and end the connection
res.end('Hello World!n');
});
// Start the server on port 3000
app.listen(3000, '127.0.0.1');
console.log('Node server running on port 3000');
In a folder that looks like this
I have already searched online for hours, looked at previous stackoverflow posts, and I still haven’t found the answer. I got the HTML file to load at one point, but I was not able to get the CSS file to load.