A contact form built in Next.js makes use of the FormSubmit API to send emails upon clicking the submit button. Below is the code for the onSubmit handler:
const handleSubmit = async (e) => {
e.preventDefault();
const res = await fetch("https://formsubmit.co/ajax/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="3b42554c4759614a40484d0f424e4c">[email protected]</a>", {
method: "POST",
headers: {
"Content-Type": "application/json",
Accept: "application/json",
},
body: JSON.stringify({
name: "FormSubmit",
message: "I'm from Devro LABS",
}),
})
.then((response) => response.json())
.then((data) => console.log(data))
.catch((error) => console.log(error));
};
The issue here is that the fetch request URL
https://formsubmit.co/ajax/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="8df6e2fefdcfebe1f9fee7bfdac9fff5fffa8bf6faf8">[email protected]</a>
can be seen on the client side through DevTools when the request is made. I am trying to find a way to hide this URL in Next.js, but have not been successful yet. Is there a solution to address this concern?