Contact form using just Node/nodemailer

I want to create a contact form on my website, and I don’t want to use any outside provider for it, so I wanted to just use Node.js for it, and nodemailer module/package for sending mail to my own mail address when the contact form has been submitted, so my question is:
Is it possible to let MY Node.js script handle the request, for example for /contact-submit when it’s POST request or something like that.

Thank you all in advance