Reputation: 3320
I have a page - index.html and chat.html.
On page index.html - I have a form and inputs (input1 and input2) and the button.
When I press the button I want to save the entries using node.js. When I go to the page chat.html, I want to retrieve these values.
When I refresh the page, I do not want to lose data.
Upvotes: 2
Views: 2333
Reputation: 63663
Node can "remember" the data on the server side, but you would probably want to use Express.js with its session store (backed by MongoDB or Redis) to keep that data even after the process restarts (unless there's no problem in loosing it).
Read more about Express on the official website and checkout these examples also: https://github.com/visionmedia/express/tree/master/examples
Other resources:
How to store session values with Node.js and mongodb?
nodeJS - How to create and read session with express
Upvotes: 1