I am trying to route files in express3 but I get a problem.
So here is the code for routing the files -
var app = require('express')(),
server = require('http').createServer(app),
io = require('socket.io').listen(server);
server.listen(8080);
// routing
app.get('/', function (req, res) {
res.sendfile("index/index.html");
app.use(app.static(__dirname + 'index'));
});
When I open localhost:8080
in Chrome it gives me an error :
TypeError: Object function app(req, res){ app.handle(req, res); } has no method 'static'
What I did wrong?
All of my HTML/CSS/JS files are in the index directory.