Here is the code snippet from my server file:
var port = 8000;
var serverUrl = "127.0.0.1";
var http = require("http");
var path = require("path");
var fs = require("fs");
console.log("Starting web server at " + serverUrl + ":" + port);
// Rest of the server file code with extensions and MIME types...
In addition to this, I have an index.html file in my GitHub project that references other folders. However, upon running the web.js file (node web.js) and navigating to localhost:8000, it indicates an issue with an invalid file extension.
Some members suggested that the problem might be due to req.url being equal to "/". Does anyone have any suggestions on how to resolve this?