Astro

A contact form in Astro. No API route.

Astro can ship a static page. A static page cannot process a POST. You do not need a src/pages/api handler or a client island for a contact form.

The HTML

<form action="https://smote.sh/f/FORM_ID" method="POST">
  <input name="email" type="email" required>
  <textarea name="message" required></textarea>
  <input type="hidden" name="_redirect" value="https://yoursite.com/thanks">
  <button>Send</button>
</form>

Where the file goes

Create src/pages/contact.astro (or drop the form into an existing page). Paste the HTML above. Astro leaves a plain <form> alone. No client:load. Replace FORM_ID from the dashboard.

Static output is enough

This works with output: "static" on Cloudflare Pages, Netlify, Vercel, or GitHub Pages. If you later add an adapter, leave the form pointed at smote — you still do not want to operate mail from the adapter.

Get an action URL Docs

Also: GitHub Pages · Hugo · Jekyll · Cloudflare Pages · Any static site