JavaScript:
const express = require("express");
const app = express();
const port = 8080;
app.use("/public",express.static(__dirname + "/public"));
app.listen(port, () => {
console.log("Application started and Listening on port "+port);
});
app.get("/", (req, res) => {
res.sendFile(__dirname + "/index.html");
});
index.html - in the root directory