var http = require('http');
var express = require('express');
var app = express();
app.use(express.static('./public'));
app.use(app.router);
app.get('/files',function(req,res){
res.sendfile('images/ye.jpg');
});
http.createServer(app).listen(3000, function() {
console.log('App started');
});
代码是这样的,浏览器输入地址http://localhost:3000/files后, 错误提示信息如下: Error: ENOENT, stat ‘D:\test\images\ye.jpg’ 但是浏览器输入地址http://localhost:3000/images/ye.jpg 能取到图片,不知道哪里有问题。