Next.js Discord

Discord Forum

My project doesn't call internal api

Unanswered
Maine Coon posted this in #help-forum
Open in Discord
Maine CoonOP
As the title sounds my APP doesn't call the internal API, when im hosting it inside my computer it works fine when im using Vercel it doesnt
const ROOT_URL = process.env.VERCEL_URL ? `https://${process.env.VERCEL_URL}` : process.env.ROOT_URL

          const response = await fetch(`${ROOT_URL}/api/update`, {
            method: 'POST',
            headers: {
              'Authorization': `Bearer ${process.env.UPDATE_API_TOKEN}`,
              'Content-Type': 'application/json',
            },
            body: JSON.stringify({
              id: idOrName2,
              newDescription: newDescription,
              userid: user,
            }),
          });

1 Reply

Maine CoonOP
Ok by doing debugging i found out the url is found by the server but still it doesn't do request