According to the ExpressJS application settings documentation, you should be able to set views
as the directory for the view engine. I am experiencing what I think may be a bug; instead of looking in the views
directory, express looks in the static
directory. Obviously it fails, since it isn't there. I have confirmed this by moving the view into the static directory, and the error goes away.
You can see this bug by cloning this Cloud9 project. I have been unable to confirm this bug outside of Cloud9, (I don't have a linux box available).
The directory structure is simple
project
|-client
|-assets
|-views
|-index.html
|-server.js
here is the server config
var viewDir = __dirname + '/client/views/';
var assetDir = __dirname + '/client/assets/';
//Configure
app.configure(function() {
app.set('views', viewDir);
app.use(express.bodyParser());
app.use(express.methodOverride());
app.use(express['static'](assetDir));
app.use(app.router);
});
app.get('/', function(req, res){
res.render('index');
});