I want to make a website to test some things. The site is running on my home server made with Wamp. I was told I could make a small database using JSON files. I have a JSON file in the site folder that contains the following:
[
{
"titulo":"Filme A",
"titulo original":"Movie A",
"duracao":"120 min",
"genero":"Genero 1",
"Atores":"Nome 1, Nome 2",
"Rate":"1",
"Visto":"sim"
},
{
"titulo":"Filme B",
"titulo original":"Movie B",
"duracao":"160 min",
"genero":"Genero 2",
"Atores":"Nome 1, Nome 2",
"Rate":"2",
"Visto":"sim"
},
{
"titulo":"Filme C",
"titulo original":"Movie C",
"duracao":"140 min",
"genero":"Genero 3",
"Atores":"Nome 1, Nome 2",
"Rate":"",
"Visto":"nao"
}
]
With your help I was able to list the properties of these JSON array objects.
Now I'm trying to save a new object inside this JSON array through information that the user places when the questions are asked and for this I need a scripting on the server side, I chose the Node .js for being a bit more familiar with JavaScript. I have little knowledge and almost none of Node.js. But even so I would like any help from you so I try to learn something. I have read on the internet about the node.js and JSON but I still have not understood how to save the JSON on the server using the node. Any explanation will be a lot of help.
See the JSFiddle