Resource not found after deployment for endpoint

Minqi Pei 0 Reputation points
2023-06-16T21:57:54.6566667+00:00

I am using next.js.

endpoint works well locally.
After deployment, the endpoint located in api/mail cannot be found, and Post request failed

try {
            const response = await fetch(
              "/api/mail",
              {
                method: "POST",
                headers: {
                    'Content-Type': 'application/json',
                  },
                body: JSON.stringify(data)
              }
            );

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,646 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.