Vamos a hacer un CRUD para la siguiente ‘base de datos’
{ "notes": [ { "id": 1, "content": "HTML is easy", "date": "2023-01-03T10:30:11.414Z", "important": false }, { "id": 2, "content": "Browser can execute only JavaScript", "date": "2019-05-30T18:39:34.091Z", "important": false }, { "id": 3, "content": "GET and POST are the most important methods of HTTP protocol", "date": "2023-01-09T09:29:26.131Z", "important": true }, { "content": "Cchuetes", "date": "2022-12-18T20:25:10.598Z", "important": true, "id": 4 }, { "id": 5, "content": "Comprar pan", "date": "2023-01-09T08:46:37.794Z", "important": false }, { "content": "Nueva nota", "date": "2023-01-09T09:29:21.122Z", "important": false, "id": 6 } ] }
De momento solo gestionamos el contenido. La fecha la ponemos automáticamente y si es importante o no lo dejamos de lado, ponemos siempre ‘false’.