I have created one nodejs application using express to serve my portfolio and my projects. My portfolio is working fine when root is accessed "/" but when i serve my projects like "/FootballScores" and "/FacebookGrabber", one is working half(means all angular files loaded successfully but still it displays nothing) and the other project is not loaded and it shows error :
"Error: Cannot find module 'html'"
Also I have installed all the npm packages. Here is the app.js code:
var express = require("express"),
app = express(),
bodyParser = require("body-parser"),
nodemailer = require("nodemailer"),
xoauth2 = require("xoauth2"),
path = require("path");
app.use(express.static(path.join(__dirname, "public")));
app.use(bodyParser.urlencoded({extended: true}));
app.get("/", function(req, res){
res.render("index.html");
});
app.get("/FacebookGrabber", function(req, res){
res.render("FacebookGrabber/index.html");
});
app.get("/FootballScores", function(req, res){
res.render("FootballScores/index.html");
});
app.listen(3000, process.env.IP, function(){
console.log("Portfolio Server Started!");
});
I think the problem is because of incorrect public path... What can i do so my projects /FootballScores and /FacebookGrabber also gets loaded correctly?