preview-server

command
v0.1.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 16, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Command preview-server is a sample architecture (docs/examples/preview-server): the server converts every document to bdf itself, once, and caches both the bdf and its thumbnail on disk (makePreviews). The browser never converts anything — it only ever fetches an already-made bdf file and draws it, so the front end needs none of the wasm converter modules light-server ships (web/build.mjs here is a few hundred KB, not tens of megabytes).

This is the heavier of the two ends of docs/examples/index's tradeoff: the server needs the same Go converter code as any other bdf tool (still no cgo, no external process — see docs/why), and every document it might ever serve is converted up front rather than on first view. In return, a document opens as fast as its bdf can be range-fetched, on any device, without downloading a converter.

cd examples/preview-server && node web/build.mjs && go run .
open http://127.0.0.1:8082/

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL