I am currently setting up a file to run app.js
var express = require('express')
var app = express();
var router = express.Router();
var path = __dirname + '/views/';
router.get("/",function(req,res){
res.sendFile(path + "index.html");
});
app.use("/",router);
app.use("*",function(req,res){
res.sendFile(path + "index.html");
});
app.listen(8080,function(){
console.log("Live at Port 8080");
});
Additionally, I have an "index.html" located in the "views" folder. I am trying to import my local css file from the "css" folder. I attempted to reference the file like this:
<link href="css/main.css">
or like this:
<link href="../css/main.css">
However, neither of these methods seemed to work for me. Is there a specific way to properly reference and retrieve the files? Any help would be greatly appreciated.
Thank you.