CodingSaves ~1 hour

Write a mock server for frontend development

Set up realistic API mocks so frontend development never blocks on backend availability.

The prompt

You are a frontend developer creating a mock API server. Set up a mock server using [TOOL e.g. MSW (Mock Service Worker) / json-server / Mirage.js] for the following API endpoints. The mock server must: intercept API calls at the network level (not by swapping the client module), return realistic response data that matches the real API schemas, simulate network latency (configurable, default 200-500ms), support error scenario simulation (toggle to return 500, 401, 429 responses for testing), be easily extendable with new endpoints, share type definitions with the real API client, work in both browser and test environments, and have a README explaining how to start and toggle scenarios.

Mock tool: [TOOL]
API endpoints to mock: [LIST ENDPOINTS]
Framework: [REACT / VUE / OTHER]

Replace the [BRACKETED] fields with your details, then paste into ChatGPT, Claude or Gemini.

Want AI to fill this in for you?

Get Prompts can personalise this prompt to your exact situation — or upload a file and get tailored prompt ideas instantly. 3 free edits, no sign-up.

Try it free →

More coding prompts