DEV Community

Discussion on: Build and Deploy a Serverless ReactJS Contact Form with Nodemailer and Netlify Functions

Collapse
 
ishamjassat profile image
Isham Jassat

Strange - do you have more detail? E.g. any error messages, the Netlify function logs etc? Link to a repo?

Collapse
 
sachafrosell profile image
Alexander Frosell

I basically just get a 404 post error even when running with npm start. Works perfectly when using netlify dev

Thread Thread
 
ishamjassat profile image
Isham Jassat

Ok, first thing I would suggest is to check your netlify.toml file and make sure the redirect is setup correctly:

[build]
functions = "functions"
[[redirects]]
from = "/api/*"
to = "/.netlify/functions/:splat"
status = 200

But without seeing your code I’m a bit in the dark. So if you post your code on stackoverflow and send me a link to the question, or a direct link to your GitHub repo I can help troubleshoot

Thread Thread
 
ishamjassat profile image
Isham Jassat

I guess the other thing to try is to reference the fully qualified production URL - https://[your app name].netlify.app/api and see if that works