Next.js Discord

Discord Forum

route is doing get instead of post on production

Unanswered
Somali posted this in #help-forum
Open in Discord
SomaliOP
I have a weird issue right now: on local everything is fine, but on production my route is calling the GET handler and not the POST,
my method is correct
const response = await fetch(`${process.env.NEXT_URL}/api/passwordless/send-link`, {
      method: 'POST',
      headers: {
        "Content-Type": "application/json",
      },
      body: JSON.stringify({
        email: rawFormData.email,
      })
    })

but it keeps going for the GET route in the /api/passwordles/[action]/route.ts where I have a GET and a POST method.

1 Reply

SomaliOP
on local everything is fine, but after building on docker and pushing it doesn't work