Next.js Discord

Discord Forum

CRUD in nextjs14 with external api

Unanswered
Cuban Crocodile posted this in #help-forum
Open in Discord
Cuban CrocodileOP
Hi all pls how do you implement CRUD in nextjs14 on server with external api and are you able to display the response coming from that api on client ? I have tried it once with the fetch but didn’t got the message error coming from the api so I had to throw a custom error. Can someone help me or if you have a resource or blog ?

2 Replies

@Cuban Crocodile If you can explain in more detail?
@James4u <@946050667762552852> If you can explain in more detail?
Cuban CrocodileOP
Hi
Actually I have a external api and I want to use the routes provided by that api to add, display and update data. I try to make request on server side using the fetch function extended by nextjs but I can't retrieve the error message from the api (in case the status is 404 for example).
https://nextjs.org/docs/app/api-reference/functions/fetch