How to organize a redirect?

There is a standard form:
<form method="post" action="/notes"></form>

Take data like this:
app.post('/notes', (req, res) => {
 const data = req.body;
Res. redirect('/page');
});


When hit on /page I have a query in the database. The data for the query are taken from form. And was redirected of course, they lost. How to do a redirect so that the possibility of access to this data?
July 4th 19 at 22:58
2 answers
July 4th 19 at 23:00
Can try to use $stateParams and transmit data directly with redirect in the url:
$state.go("/pages", {data: yourData}); in this case when you restart the controller data will be stored in data.
Approximately
July 4th 19 at 23:02
Use of quarry settings. Are passed in the url after the "?" in the form key=value & dragonly=dugotrajna

app.post('/notes', function(req, res){
 var options = body;

 var _name = options.name;
 var _age = options.age;

Res. redirect('/page?name=_name&age=_age')
})

app.get('/page', function(req, res){
 var options = req.query;

 var name = options.name;
 var age = options.age;

....
})
I the second parameter is the password. Is it safe just to Shine them in the address bar? - brannon_Christians commented on July 4th 19 at 23:05
In any case. Well you can send data from the form, for example, the route '/signIn', there to make search on database, and in case of finding of conformity - redirect '/home' - jermain_Hoeg commented on July 4th 19 at 23:08

Find more questions by tags Express.jsNode.js