M
M
mrerer2019-11-12 18:53:18
Mongoose
mrerer, 2019-11-12 18:53:18

Where is the best place to store posts (on the back) to a React blog?

Good day.
Where and in what form is it customary to store blog posts on the MERN stack (MongoDB, React, Redux, Node, Express). Interested in this stack.
As planned, there will be about 50 posts and a component that displays them, depending on the navigation transitions.
The problem is how to store the information? I was thinking of storing such posts as part of the server-side HTML markup in the database, but then how do I then embed them in a React component? Is it better to store information as an Object? Let's say { "h1": "First article", "p": "Lorem ...."} and then transform all this on the client through a function? Or first write the post as part of HTML, then convert to UTF and save to the database...
Or is it better to store everything on the client? But still the question is in what form?
Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
vadimMalovaniy, 2019-11-12
@mrererer

In MongoDB, as an array of JSON objects with text. React should just take the text and paste it into the template.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question