Menu

Developer documentation

This section is for people who write sites on MicroHost: static files in public/, server-side JavaScript handlers, a private SQLite database, and the SDK that connects them. Everything here describes what the code does today. Where a feature is partial or unverified, the page says so in a Status note, and Engine differences and status collects them in one table.

Reading order

  1. How a MicroHost site works: the request lifecycle and what is static versus scripted.
  2. Quickstart: the smallest site, then a site with a database.
  3. The reference pages below, as needed.
  4. Guides: login with sessions, pagination, error handling.

Reference

Page What it covers
Handler API The handler contract, Request, Response, Headers, URL, encoding, crypto, console, and what is not available.
Context (ctx) ctx.db, ctx.storage, ctx.env, ctx.mail, fetch, ctx.dbs, ctx.admin.
SDK modules microhost/sql, microhost/db, microhost/auth, microhost/session: requesting, importing, the per-site switch.
Database SDK sql templates, table objects, filters, Rows, paging, error codes.
Auth and sessions Password hashing, session cookies, the site_sessions table, what you must still do yourself.
Routing Route grammar, patterns, convention routes, precedence, request.params.
Site layout Directories, reserved names, imports, what is reachable from the web.
Manifest (microhost.json) Every field, validation rules, requests versus grants.
Config script (microhost.config.js) defineSite, route, defineExtension, field, files.
Scheduled and background jobs jobs in the manifest, cron schedules, the job script and its headers, retries, limits, run history.
Migrations private/migrations/*.sql, naming, when they run, the schema snapshot.
Admin extensions Queries, actions, pages and forms in the admin UI, and the private handler contract.
Limits and errors Execution limits, host-call limits, HTTP status mapping, error codes.

Working with a site

Page What it covers
Deploying ZIP, Git, the in-browser editor, staged releases, activation, rollback, grants.
Testing sites What exists for local testing, and what does not.
Examples Walkthroughs of the blog, tasks and login examples, including known problems.
Engine differences and status What works on the Wasm, native and Linux engines; what is partial.

Other references: the editor declarations in sdk/microhost.d.ts, the shorter SDK summary in sdk/README.md, and the design records ADR-0021 to ADR-0028. ADRs describe intent; where an ADR and the code differ, these pages follow the code.