Express deprecated res.sendfile
-
Em là member mới và mới học NodeJs, em chạy code trong file index.js :
module.exports = function (app) {
app.get('*', function(req, res){
res.sendfile('front-end/build/index.html');
});
};nó bị lỗi như hình.
Cấu trúc folder của em:
back-end
--- route
--- index.js
front-end
---- build
---- index.htmlEm gà quá tìm không ra lỗi, mấy đại ka giúp em với nha. Em cảm ơn nhiều.
-
Đổi viết thường thành viết hoa thôi em res.sendFile
-
Hi a Quốc Cường, em đổi rồi mà vẫn ko được anh ơi
-
Không được là sao hả em. Vẫn báo deprecate à ? . Cái sendFile này em dùng absolute link nhé dang path.resolve( __dirname,"..","frontend/..."
-
E thử của anh nó bị vầy nè a:
-
Nó bị này là vì sao vậy mí anh!
Híp e đi