mardi 25 août 2020

Express js route with different ids

Im using node js with express lib.There are pages like localhost/page/1,localhost/page/2. They are pretty similar but some information must change depending on page id. Im redirecting to this pages with form submit.

<form method='GET' action='/order_page/" + order.id[i] + "'><input type='submit' value='move'></form>

and in my server js

app.get('order_page/:id', checkUserSession, function(request, response) {
    response.send(req.id);
});

it redirects and gives me error Cannot GET /order_page/6

What's the best solution to this issue?




Aucun commentaire:

Enregistrer un commentaire