light-server

command
v0.1.6 Latest Latest
Warning

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

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

Documentation

Overview

Command light-server is a sample architecture (docs/examples/light-server): the server never converts a document to bdf. It serves the documents as they are and a thumbnail image of each (made once, ahead of time, by converting in memory and throwing the bdf away — see makeThumbnails), and the browser does the actual conversion and rendering, using the bdf converters built as WebAssembly (web/build.mjs builds them, reusing examples/common/build.mjs, the same helper the demo site is built with).

This is the lightest server of the three sample architectures (docs/examples/index): no Go conversion code runs on every view, only once per document to draw its thumbnail, and the server holds no bdf at all. It costs the browser a WebAssembly module to fetch and a moment to convert the file locally — the same tradeoff the demo site itself makes. See docs/examples/preview-server for the opposite tradeoff.

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

Jump to

Keyboard shortcuts

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