abderrahmen abderrahmen - 1 month ago 6
Javascript Question

change url where to render view with Express 4

I have a post request the problem is that when I render my views it's rendered to

wheras I want that view to render to

I could've use
res.redirect ('/anotherlink')
but I need to render different data

app.post('/link/:id',function (req, res, next){
res.render('products', {
data : 'help please'


I found a better solution which is by changing the url in the view without reloading : window.history.pushState("", "", '/wantedLink');