File Routes
You can serve a file straight from disk with Mochi.file() — pass a static path, or a resolver that picks the file per request from the route params. The file is read fresh on every request, so files written or deleted at runtime are picked up immediately. Missing files (or a resolver that throws error(404)) come back as a plain-text 404.
<script>
import FileViewer from './FileViewer.svelte';
</script>
<FileViewer mochi:hydrate />
More demos
Image: Events How image events work — subscribe to image:store / image:delete on mochiEvents to mirror the <Image> cache to durable storage like S3. Shared State How shared state across islands works — two separate islands driving the same reactive $state. Portable Text How Portable Text rendering works — @portabletext/svelte maps a JSON block array onto your own Svelte components for types, marks, block styles and lists.