NodeJs Express setting a View to see folder's content rendered as html
Problem
Having this code in my server.js
...
var express = require("express");
var app = express();
// Set the view directory to /views
app.set("views", __dirname);
http.createServer(app).listen(9001);
...
I'm excepting by going here ":9001/myhtml.html"
to see my content. But instead I see:
Cannot GET /myhtml.html
Have I missed something?
Problem courtesy of: ses
Solution
app.use(express.static(path.join(__dirname, "/static_dir")))
See http://expressjs.com/faq.html
Solution courtesy of: Rell
Discussion
View additional discussion.