#handle fetching from external backend

2 messages · Page 1 of 1 (latest)

unborn osprey
#

Hey all, i'm curently working on a nextjs project with another developer.
Our API doesn't live in the nextjs app, or in the same repo even, and we currently just write fetch calls to it.

The problem is that we don't have a centralized way of handling common logic, like checking for access token, and we end up copy-pasting a lot of logic.

How do you handle and scale up requests in a nextjs project? should we use a library? should we write some kind of centralized API function?

silver scarabBOT
#

🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord

🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize

✅ You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)