CI / lint (pull_request) Successful in 3m39s
CI / format (pull_request) Successful in 3m24s
CI / install (pull_request) Successful in 9m4s
CI / typetest (pull_request) Successful in 3m5s
CI / typecheck (pull_request) Successful in 3m20s
CI / node-tests (pull_request) Successful in 3m31s
CI / browser-tests (pull_request) Successful in 5m16s
Give every workspace a README describing what it does, its entry points, and a short usage example, and link them from the root package table. Frame Tailshare in the root README as the application the libraries exist to be composed into, with the other apps as development and testing surfaces. Its own README records what works today and what the open issues intend for it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@webnet/http-static
Static file HTTP handler backed by an @webnet/vfs AsyncVFS.
createStaticHandler turns an AsyncVFS into a @webnet/http Handler: it resolves request paths against the VFS, serves files with ETag/Last-Modified conditional requests and Range support, and can render directory listings (HTML or JSON, based on Accept) or fall back to a single file (e.g. an SPA's index.html) when nothing matches.
Usage
import { createStaticHandler } from "@webnet/http-static"
import { Server } from "@webnet/http/server"
import type { AsyncVFS } from "@webnet/vfs"
import type { RawListener } from "@webnet/transport"
declare const vfs: AsyncVFS
declare const listener: RawListener
const handler = createStaticHandler(vfs, {
prefix: "/static",
index: ["index.html"],
fallback: "/index.html",
})
const server = new Server(handler)
await server.listen(listener)
See also
@webnet/http—Handler/Serverthis package's output is used with@webnet/vfs— theAsyncVFSinterface this package serves@webnet/webdav— a read/write, protocol-level alternative to serving a VFS statically