无法使用nodeJS在html中设置Image src

我在nodeJS上是新的,我无法在我的客户端html中设置img标签的src。 因为我的节点服务器运行在端口3000上,当我打到http:// localhost:3000时,

下面是我的server.js文件的代码

var app = require('express')(); var http = require('http').Server(app); var io = require('socket.io')(http); app.get('/', function (req, res) { res.sendFile('/var/www/UI-Test/client.html'); }); io.on('connection', function (socket) { console.log('user joined '); }); http.listen(3000, function () { console.log('listening on *:3000'); }); 

下面给出了client.html的代码

 <html> <body> <img src="f1.png" /> <!-- also tried "./f1.png" --> <script> var socket = io(); </script> </body> </html> 

它给404(Not Found)错误,即使f1.png文件与server.js和client.html在同一个文件夹中。 顺便说一句,我的操作系统是Ubuntu的。

提前致谢

 // At the top of your server.js process.env.PWD = process.cwd() // Then app.use(express.static(process.env.PWD + '/public')); 

并将图像存储在html部分调用中的/public/f1.png

 <img src="/f1.png" />