Lập trình web Nodejs: Quà tặng giáng sinh 2016

Khoá học lập trình Nodejs tại Khoa Phạm: http://www.khoapham.vn/khoa-hoc-lap-trinh-nodejs.html
Trang học lập trình Online: http://online.khoapham.vn
Full video: http://online.khoapham.vn/node-js/55-lap-trinh-web-nodejs-qua-tang-giang-sinh-2016.html
Các video
Lập trình web Nodejs: Quà tặng giáng sinh 2016
-
1 - Lập trình web Nodejs: Quà tặng giáng sinh 2016 Free
-
2 - Lập trình Web NodeJS - Bài 1: Khởi tạo dự án Free
-
3 - Lập trình Web NodeJS - Bài 2: Truy xuất CSDL hiển thị thông tin ra trang chủ Free
-
4 - Lập trình Web NodeJS - Bài 3: Xây dựng trang quản trị video Free
-
5 - Lập trình Web NodeJS - Bài 4: Chi tiết chức năng delete video Free
-
6 - Lập trình Web NodeJS - Bài 5: Chi tiết chức năng add Free
-
7 - Lập trình Web NodeJS - Bài 6: Chức năng edit video Free
Thông tin giảng viên

Bình Luận
-
cho mình hỏi lỗi gì và làm sau khắc phục
Debugger listening on [::]:5858
rat tiet khong the ket noi { Error: connect ECONNREFUSED localhost:5432
at Object.exports._errnoException (util.js:1020:11)
at exports._exceptionWithHostPort (util.js:1043:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1090:14)
code: 'ECONNREFUSED',
errno: 'ECONNREFUSED',
syscall: 'connect',
address: 'localhost',
port: 5432 }
-
ad có thể cho em xin file tài liệu được không ạ!
lockdownhnn@gmail.com
Cho em hỏi em bị lỗi này làm sao khắc phục được
node index
Server started on port 3000
ReferenceError: req is not defined
at app.post (F:\uphinh\index.js:97:10)
at Layer.handle [as handle_request] (F:\uphinh\node_modules\express\lib\router\layer.js:95:5)
at next (F:\uphinh\node_modules\express\lib\router\route.js:137:13)
at Route.dispatch (F:\uphinh\node_modules\express\lib\router\route.js:112:3)
at Layer.handle [as handle_request] (F:\uphinh\node_modules\express\lib\router\layer.js:95:5)
at F:\uphinh\node_modules\express\lib\router\index.js:281:22
at param (F:\uphinh\node_modules\express\lib\router\index.js:354:14)
at param (F:\uphinh\node_modules\express\lib\router\index.js:365:14)
at Function.process_params (F:\uphinh\node_modules\express\lib\router\index.js:410:3)
at next (F:\uphinh\node_modules\express\lib\router\index.js:275:10)
Đây là đoạn code của em
app.post("/Edit/:id",(reg,res)=>{
const id=reg.params.id;
upload(req, res, (err) => {
if(err){
res.send("Loi up load");
} else {
if(typeof(req.file) =='undefined'){
pool.connect((err,client,done)=> {
if(err){
return console.error("Dinh loi rui",err);
}
client.query("UPDATE hinhanh WHERE id='"+id+"')",(err,result)=> {
done(); // closing the connection;
if(err){
return console.error("Dinh loi rui 2",err);
}
res.redirect("../list");
});
});
} else {
pool.connect((err,client,done)=> {
if(err){
return console.error("Dinh loi rui1",err);
}
client.query("update hinhanh set hinhanh='"+req.file.originalname+"' where id='"+id+"'",(err,result)=> {
done(); // closing the connection;arams.
if(err){
return console.error("Dinh loi rui 3",err);
}
});
});
res.redirect("../../list");
}
}
});
});