0
Lỗi GET file img, js khi deploy NodeJS
Chào mọi người. Mình đang viết 1 website sử dụng nodejs, express. trong file app.js mình đã cấu hình static file: app.use(express.static(path.join(__dirname, 'public')));
Folder mình như sau: -app.js -src --public ---js ---css ---img Khi chạy trên local thì k báo lỗi, nhưng deploy lên thì báo lỗi /img/logo.png 502 (Bad Gateway) /img/favicon.ico 502 (Bad Gateway) /js/scripts.js net::ERR_ABORTED 502 (Bad Gateway) Refused to execute script from 'https://.../js/flowbite.min.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.|
Nhờ mọi người hướng dẫn cách sửa lỗi này. Mình cám ơn!
Thêm một bình luận