MERN STACK with CONTENTFUL

Hi All, I am working on a MERN stack development using contetnful as a data store. I need one example code of how to send back the contentful data from NodeJS applicaiton to the frontend ReactJS and display it there. I have seen many NodeJS examples which connect to Contentful using SpaceID, Access Token using createClient method and then fecth the data using client.getEntry etc. But how do we pass the data back to the caller which is ReactJS application, assuming that we make a API call to the backend as usual. It would be great if someone can send me a sample code please. Thanks in advance and I really appreciate your response. Thank you

Hey @tech.talentsin,

I don’t have a sample project for reference. But what you mentioned, I would do just that. On the React side, I would call the API endpoints to fetch the content. The backend (Node.js) will handle these calls, fetch the content, and pass it to the front-end.

Thanks Harshil, appreciate your support.

1 Like