Dev Tools
Client-sidefiles never upload

Mock API designer

Design endpoints + responses. Export ready-to-use config for Mockoon, Playwright, Postman, or json-server. Pure client-side, zero cost — bring your own runner.

Endpoints

import type { Page } from "@playwright/test";

export async function mockEndpoints(page: Page) {
  await page.route("**/api/users", async (route) => {
    if (route.request().method() !== "GET") return route.continue();
    await route.fulfill({
      status: 200,
      headers: { "Content-Type": "application/json" },
      body: "[{\"id\":1,\"name\":\"Mark\"}]",
    });
  });
}

// Usage in a test:
//   test.beforeEach(async ({ page }) => { await mockEndpoints(page); });

⚠️ This tool does not expose any live endpoint on our server. Take the generated config and run it locally / in CI / on your own infra.

How to use (this is a designer, not a live mock server)
  1. Add endpoints on the left: pick method, write path, set status / delay / response body.
  2. Pick a target format on the right: Playwright / Mockoon / Postman / json-server.
  3. Right side shows the generated config — hit Copy or Download.
  4. Take the config to your target tool (see Tips below).
Tips
  • Playwright: add the downloaded .ts to your test project and call await mockEndpoints(page) in beforeEach.
  • Mockoon: Open Mockoon → File → Open environment → choose the downloaded JSON → start it. API serves at http://localhost:3001.
  • json-server: in a terminal run npx json-server db.json → API at http://localhost:3000.
  • Postman: File → Import → choose the collection, then create a mock server inside Postman.

⚠️ To prevent abuse, we do not host live mock endpoints on dev.9niche.com. A hosted mock service would require auth + rate limiting + TTL, planned as Phase 2.

Related tools