一、socket.io指定客户端html文件所用到的sendFile()方法中的文件路径必须是绝对路径,而且要符合一定规则:
app.get('/',function(req,res){
res.sendFile('D:\\\\angular-vmaer-0812\\\\socket\\index.html');
});
sendfile可以用相对路径
一、socket.io指定客户端html文件所用到的sendFile()方法中的文件路径必须是绝对路径,而且要符合一定规则:
app.get('/',function(req,res){
res.sendFile('D:\\\\angular-vmaer-0812\\\\socket\\index.html');
});
sendfile可以用相对路径
转载于:https://www.cnblogs.com/kuangliu/p/3915054.html