набираю http://localhost:3000/somesmart/?id=9 выдает ошибку Cannot GET /somesmart/ вот код Код (Javascript): app.get('/somesmart/:id', function(req, res) { var somesmart = []; // Connect to MySQL database. var connection = getMySQLConnection(); connection.connect(); // Do the query to get data. connection.query('SELECT `prod`,`name`,`sim`,`display`,`razresh`,`acum`,`proc`,`oper`,`sd`,`cam`,`gps`,`description`,`giroscope`,`payment`,`photo` FROM `smartphone` WHERE '+ mysql.escape(req.params.id), function(err, rows, fields) { if (err) { res.status(500).json({"status_code": 500,"status_message": "internal server error"}); } else { // Check if the result is found or not if(rows.length==1) { // Create the object to save the data. var smart = { 'prod':rows[0].prod, 'name':rows[0].name, 'sim':rows[0].sim, 'display':rows[0].display, 'razresh':rows[0].acum, 'acum':rows[0].acum, 'proc':rows[0].proc, 'oper':rows[0].oper, 'sd':rows[0].sd, 'cam':rows[0].cam, 'gps':rows[0].gps, 'description':rows[0].description, 'giroscope':rows[0].giroscope, 'payment':rows[0].payment, 'photo':rows[0].photo, 'giroscope':rows[0].giroscope, 'price':rows[0].price, 'webs':rows[0].webs, 'os':rows[0].os, 'rom':rows[0].rom, } somesmart.push(smart); // render the details.plug page. res.render('somesmart', {"somesmart": somesmart}); } else { // render not found page res.status(404).json({"status_code":404, "status_message": "Not found"}); } } }); // Close MySQL connection connection.end(); }); ВОТ pug Код (Javascript): html head title= 'Phones' style include style.css include bootstrap.css body h1= 'Smartphone: '+ somesmart.name div= "id" + somesmart.id img(src=""+somesmart.photo+"") div= "Производитель: " + somesmart.prod div='Модель: ' + somesmart.name div='Количество СИМ карт: ' + somesmart.sim div='Диагональ дисплея: ' + somesmart.display div='Разрешение дисплея: ' + somesmart.razresh div='Аккумулятор: ' + somesmart.acum div='Процессор: ' + somesmart.proc div='Поддержка SD: ' + somesmart.sd div='Камеры: ' + somesmart.cam div='Датчик GPS: ' + somesmart.gps div='Описание: ' + somesmart.description div='Гироскоп: ' + somesmart.giroscope div='Безконтактная оплата: ' + somesmart.payment
Путь и маршрут не совпадают вроде Или урл такой должен быть http://localhost:3000/somesmart/9 Либо маршрут /somesmart/?id=:id