我想在express3路由文件,但我遇到了問題。
所以這裏是路由文件的代碼 -express3 - 試圖路由文件
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'));
});
當我在Chrome中打開localhost:8080
它給了我一個錯誤:
我做了什麼錯?
我所有的HTML/CSS/JS文件都在索引目錄中。
可能重複(http://stackoverflow.com/questions/4529586/render-basic-html-view-in-node-js-express) – zemirco 2013-02-20 09:09:22