I am building a blog with Next.js. I need my contact page to include a contact form so visitors can send emails via Nodemailer.
I am fairly new to Express so I feel in a little over my head. Should I be customizing the Next.js server?
Or should I make a separate server? If so, is that completely separate from my Next.js app?
I currently have pages/contact rendering a form. I am not worried about actually sending the email and all that Nodemailer stuff. I just don't understand where I should be hooking up my configurations.
What would be the recommended way to do implement such a contact form?
Any help greatly appreciated. Thank you!
Or should I make a separate server? If so, is that completely separate from my Next.js app?
This is what we recommend at ZEIT, our frontend (zeit.co) is decoupled from the backend (api.zeit.co).
@jeanmaried I wrote a little piece about doing this: https://medium.com/the-couch/adding-a-contact-form-to-your-next-js-app-7a1b5f63f27
I needed some custom routing so I did the express setup which I talk about, but also if the only thing you need the express service for is the form theres no reason to spin up a microservice for just handling a simple form.
Most helpful comment
@jeanmaried I wrote a little piece about doing this: https://medium.com/the-couch/adding-a-contact-form-to-your-next-js-app-7a1b5f63f27
I needed some custom routing so I did the express setup which I talk about, but also if the only thing you need the express service for is the form theres no reason to spin up a microservice for just handling a simple form.