API Endpoints
You can build JSON routes with Mochi.api().
+
Click an endpoint to test it
<script>
import ApiTester from './ApiTester.svelte';
</script>
<ApiTester mochi:hydrate />
More demos
Client-only Islands How client-only islands work — components marked mochi:clientOnly skip SSR and mount in the browser, with a fallback snippet until then. Hacker News Clone A full Hacker News reader built on Mochi — SSR pages, hydrated islands, real API. Real-time Chat How WebSocket routes work — a hydrated island over Mochi.ws() with pub/sub broadcast and in-memory history.