Node.js is kinda new, so I hardly can find things in internet.
I have already solved this. It was because I was calling from client side using $.ajax
.
But when
I successfully solved it by myself!
I found out that it happened because I call the route from $.ajax
from the client.
When I change the calling method by putting this code into the form and remove the $.ajax
, it's done. Thank you @mscdex
form(role="form" method="POST")
and I changed the route /contact/sendEmail
to just /contact
.