I tried to simply get locations of photos in my route and render product.ejs file:
//Show individual product info
router.get('/product/:id', async function(req, res, next) {
let filesFromFolder;
Promise.all([
database.retreaveImage(req.params.id)
]).then(resultArr => {
filesFromFolder = resultArr[0];
res.render('product.ejs', {
productName: req.params.id,
data: filesFromFolder
});
});
});
It works on localhost, now i importet my route.js file in real server, and when i try to open product it throws 504 error.
tried to follow this instructions but no help.
Getting 504 GATEWAY_TIMEOUT NodeJs
grep -i "504" /var/log/nginx/access.log
82.135.208.60 - - [16/Sep/2019:07:52:25 +0000] "GET /product/line_fan_pool HTTP/1.1" 504 594 "http://13.58.120.242:3000/horizontal" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Safari/537.36" 82.135.208.60 - - [16/Sep/2019:08:03:15 +0000] "GET /product/line_pool HTTP/1.1" 504 594 "http://13.58.120.242:3000/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Safari/537.36" 82.135.208.60 - - [16/Sep/2019:08:10:19 +0000] "GET /product/line_pool HTTP/1.1" 504 594 "http://13.58.120.242:3000/" "Mozilla/5.0 (Linux; Android 6.0; Nexus 5Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.132 Mobile Safari/537.36"