Currently, I am in the process of developing a webpage that utilizes Angular to dynamically alter DOM elements. The project includes a public folder housing HTML, CSS, JavaScript, and JSON files. To share the project, I have set up Node to run it from localhost. Below is an excerpt from my server.js code:
var express = require('express');
var app = express();
var path = require('path');
app.get('/', function(req,res){
res.sendFile(path.join(__dirname + '/public'));
});
app.listen(8080, function(){
console.log((new Date()) + " Server is listening on port 8080");
});
When I try to access localhost:8080, it displays 'Cannot GET /'. What mistake might I be making?