A static site is easy until someone needs to write to you.

mailto: leaks your address to scrapers. A Google Form looks like a Google Form. And the usual next step — Formspree, Basin, Netlify Forms, a serverless function plus a database — is either a monthly bill or a small project of its own.

You can host a tiny form backend yourself. This post walks through a working setup: a plain HTML form, a Node.js endpoint with no npm dependencies, a honeypot, and an inbox that is just a file on disk.

The finished starter is called Formbox Lite. It is free and MIT licensed. You can follow along and write it yourself, or clone the repo at the end and run node server.js.

1. The form on your site

No JavaScript required:

<form action="https://forms.yourdomain.com/f/contact" method="POST"> <label>Name <input type="text" name="name" required></label> <label>Email <input type="email" name="email" required></label> <label>Message <textarea name="message" required></textarea></label> <input type="text" name="_gotcha" tabindex="-1" autocomplete="off" style="position:absolute;left:-8000px" aria-hidden="true"> <input type="hidden" name="_next" value="/thanks.html"> <button type="submit">Send</button> </form> 

The _gotcha field is a honeypot. People never see it. A lot of bots still fill every input they find. If that field is not empty, the server should pretend the submit worked and then throw the message away.

_next is where the browser goes after a successful HTML submit. The server must only redirect to a path on your own origin, or you have built an open redirect.

2. A server that only does one thing

You do not need Express for this. Node's built-in http module is enough:

  • POST /f/contact accepts application/x-www-form-urlencoded or application/json
  • Reject an empty body
  • Reject the honeypot (with a fake success)
  • Rate-limit by a hash of the client address — do not store raw IPs
  • Append a JSON object to data/submissions.jsonl
  • Redirect to /thanks.html, or return { ok: true, id } if the client asked for JSON

JSON Lines is an underrated database for a contact form. You can read it with any editor, back it up by copying one file, and grep it when you need to. You only outgrow it when you have many forms, search, or notifications — not on day one.

3. An inbox you can actually open

A raw .jsonl file works, but a /inbox page is nicer when you are testing. On localhost it can be open. In production, put a password in front of it and serve it over HTTPS.

That is the whole product for a personal site: form, endpoint, file, inbox.

4. What this does not do (yet)

A one-form starter will not:

  • email you when a message arrives
  • post to Slack or a CRM
  • run captcha or a serious spam model
  • manage ten forms for ten sites

If you need those, you are in "real form backend" territory. I also make a fuller kit for that. For a single contact page, the lite server is enough.

5. Run it

# download the zip from the link above and unzip it cd formbox-lite node server.js 

Open http://127.0.0.1:3000, send a message, then open /inbox. There is a short go-live checklist in the README (HOST, PUBLIC_URL, ALLOWED_ORIGIN, INBOX_PASSWORD, a persistent disk).

Download (free, pay-what-you-want): https://richestcountry.gumroad.com/l/formbox-lite

If you want the multi-form dashboard, spam filtering, SMTP and signed webhooks: Formbox Kit ($19).

Questions and patches are welcome. Tell me what broke when you put it in front of a real site.