Skip to content

mockrMock API server for frontend prototyping

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.

Quick start

bash
npm install @yoyo-org/mockr zod
npx tsx mock.ts
ts
import { 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.

Continue with the tutorial →

MIT License