1

Im trying to fetch an webhooks url using Environment Variables. here is my code

      const url = process.env.WEBHOOK_URL;
      const response = await fetch(
        `${url}` ,
        {
          body: JSON.stringify({
            name,
            email,
            message,
          }),
          headers: {
            'Content-Type': 'application/json'
          },
          method: 'POST'
        }
      );

But the error show up "Only absolute URLs are supported" please help! Thank you

Tan Huynh
  • 105
  • 11
  • 1
    Does this answer your question? [Next.js - Error: only absolute urls are supported](https://stackoverflow.com/questions/44342226/next-js-error-only-absolute-urls-are-supported) – brc-dd Jun 07 '21 at 13:31

0 Answers0