examples/raw-fetch-handler/README.md
Example project demonstrating raw HTTP fetch handling with Hono integration.
git clone https://github.com/rivet-dev/rivet.git
cd rivet/examples/raw-fetch-handler
npm install
npm run dev
onRequest for low-level HTTP request handling with custom routingcreateVarsThe backend defines a counter actor with a Hono router embedded in the onRequest handler. Each counter is identified by a unique name, and the frontend can interact with counters through direct actor fetch calls or HTTP requests through a forward endpoint. Multiple counters maintain independent state.
src/backend/registry.ts): Demonstrates onRequest handler with Hono router for custom HTTP routingraw-fetch-handler/
├── src/
│ ├── backend/ # RivetKit server with counter actors
│ └── frontend/ # React app demonstrating client interactions
└── tests/ # Vitest test suite
Read more about HTTP request handling, state, and actions.
MIT