Skip to content

v0.18.0 — static file server

Choose a tag to compare

@tshafer tshafer released this 10 Jul 20:39
· 150 commits to main since this release

serveStatic() — serve files from public/ before your routes:

this.use(serveStatic());
this.use(serveStatic({ root: "./assets", maxAge: 86400, immutable: true }));

ETag / Last-Modified / 304, Cache-Control, dot-file policy (ignore/deny/allow), per-file headers, and path-traversal protection. node:fs is loaded dynamically so the core still imports on the edge. See docs/static-files.md.