server/server library

Shelf bootstrap for dialect serve.

Mounts the REST API at /api/* and serves the embedded SPA from the binary itself (no node_modules on disk at runtime). Each request reloads the project from disk so external edits to ARB files are visible immediately — the project is tiny, the I/O is cheap, and it removes the "stale-cache" foot-gun.

Functions

buildHandler(String projectRoot) → Handler
Build the Shelf Handler for projectRoot. Pulled out of the serve command so tests can drive it without binding a real port.
startServer({required String projectRoot, String host = 'localhost', int port = 4077}) Future<HttpServer>
Bind the Shelf handler on host:port. Returns the live HttpServer so the caller (the serve command) can keep the process alive.