💾 Local Pages, Cloud Data

Your local HTML page can save data —
to the cloud

A file on your disk, opened directly in a browser, or an AI app that runs locally: both can POST to FormLM's CORS-enabled Data API. No server, no deploy.

The local page's silent failure

It works beautifully. It just can't remember anything.

Some of the most useful pages never get hosted. A personal dashboard you keep in a folder. A quiz an AI wrote for you in one conversation. A calculator or tracker that lives on your desktop and opens straight into the browser via file://. Zero deployment, zero cost, zero maintenance — and zero persistence. Close the tab and it forgets. Move the file to another machine and it forgets. localStorage looked like the answer, but it's per-browser and per-profile: your data is married to one machine's Chrome profile forever.

The fix is the same one static sites use, and it works from file:// too: a CORS-enabled storage endpoint. FormLM's Data API explicitly allows cross-origin POST and GET, so the browser's same-origin rules — which normally block a local file from calling the web — let your page's fetch straight through. Your page stays exactly where it is; its data goes to the cloud.

localStorageFormLM Data API
Survives browser profile lossNoYes
Works across devicesNoYes
Readable by other tools & agentsNoYes — HTTP query API
Export & analysisManual devtools copyCSV export + summary stats
Setup effortNoneOne free endpoint

From local page to persistent app

Two functions: save and load. That's a local app with cloud memory.
// save.js — works from file:// thanks to CORS
async function save(entry) {
  const res = await fetch("https://formlm.me/api/v3/share/YOUR_TOKEN", {
    method: "POST",
    headers: { "Content-Type": "application/json" },
    body: JSON.stringify({ data: entry, meta: { source: "local-page" } })
  });
  return res.json();
}

// load.js — read everything back
async function load() {
  const res = await fetch("https://formlm.me/api/v3/share/YOUR_TOKEN/query?page=1&size=100");
  return res.json();
}

With those two functions, a plain HTML file becomes a small application whose data outlives the browser, syncs across machines, and can be exported or analyzed at any time. If the page was written by an AI agent, you can hand it the endpoint's ?help documentation and let the agent wire these calls itself — the AI agents guide shows the pattern.

One caveat that comes with any cloud storage from a local page: the endpoint token is visible in the page source, so treat the data as semi-public — fine for logs, trackers, and prototypes; wrong for secrets. Anyone with the token can submit to (and, if query is enabled, read) that form.

Frequently asked questions

Can a local HTML file save data?

Yes — by POSTing to a cloud API. localStorage only persists per-browser and is lost when the file moves or the browser profile clears. A CORS-enabled endpoint like FormLM's Data API accepts fetch calls from file:// pages, so your local file can store data on the web.

Does fetch work from a file:// page?

Yes, when the remote endpoint allows cross-origin requests. FormLM's Data API sends the necessary CORS headers for POST and GET, so a page opened directly from disk can submit and read data. Endpoints without CORS would be blocked by the browser's same-origin rules.

What's wrong with localStorage for this?

localStorage is per-browser, per-profile, and per-machine: your data dies with the profile. It also can't sync between devices, can't be read by other tools, and offers no query or export. A hosted endpoint gives the same ease of use with real persistence and an HTTP read path.

Can I read the data back into my local page?

Yes. The query endpoint returns your stored records as JSON, which a local page can fetch and render — turning a plain HTML file into a small app with cloud persistence for both reads and writes.

Does this work for AI-generated apps that run locally?

Yes — it's a common pattern. An AI agent writes a page that runs from your disk; you give it a FormLM endpoint to POST to; the app gains persistent storage without any deployment step. The agent can even read the endpoint's ?help docs itself.

Related guides

Your local page deserves a memory

Free endpoint, CORS for file://, data that survives the tab.

Create your free endpoint →