API Endpoints
You can build JSON routes with Mochi.api().
+
Click an endpoint to test it
<script>
import ApiTester from './ApiTester.svelte';
import { files } from './files.ts';
const sources = await loadSources(files);
</script>
<ApiTester mochi:hydrate />
More demos
Cache Events How cache events work — subscribe to MochiCache lifecycle events (hit, miss, set, evict) through mochiEvents for observability. Image: Named sizes How the image transform pipeline works — declare resize / rotate / flip / modulate / format as named sizes; getImageUrl mints a deferred URL, getImage runs one inline. Rate Limiting How rate limiting works — a rateLimit config on the route caps requests per IP per minute and serves the 429 error page past the limit.