Free CRUD from data
`data: T[]` becomes a list endpoint with GET/POST/PUT/PATCH/DELETE. `data: T` becomes a record endpoint. Mutations persist in memory.
Define endpoints, get full CRUD for free. Mock the routes you're building, proxy the rest to a real backend. Record traffic from the Chrome extension and map it to local files.
npm install @yoyo-org/mockr zod
npx tsx mock.tsimport { mockr } from '@yoyo-org/mockr';
await mockr({
port: 4000,
endpoints: [
{ url: '/api/todos', data: [
{ id: 1, title: 'Buy milk', done: false },
]},
],
});That's it. GET /api/todos returns the array. POST /api/todos inserts. PATCH /api/todos/1 updates. DELETE /api/todos/1 removes. No glue code.