WebJs Gallery
← Gallery

Route handlers

A route.ts is a server-only HTTP endpoint (named GET/POST/... exports), the WebJs equivalent of a Next route handler. It never ships to the client.

GET /features/route-handler/data returns rich JSON via json(). It carries data-no-router so the client router does not try to soft-navigate to it: a route.ts is not a page, so the browser loads its JSON directly.

A client component reading it with richFetch, so at comes back as a real Date:

click to fetch