Back to Dashboard
🎭

Dev Proxy Mock Generator

Define URL matching rules and mock responses for your frontend development. Generate MSW (Mock Service Worker) handlers or a standalone Service Worker. Save configurations locally using the File System Access API.

generators

Response Rules

MSW Handlers
import { http, HttpResponse } from 'msw';

export const handlers = [
  http.get('/api/user', () => {
    return HttpResponse.json({
      "id": 1,
      "name": "John Doe",
      "email": "john@example.com"
    }, { status: 200 });
  }),
];
Standalone Service Worker
self.addEventListener('fetch', (event) => {
  const url = new URL(event.request.url);
  const path = url.pathname;

  if (path === '/api/user' && event.request.method === 'GET') {
    event.respondWith(
      new Response('{  "id": 1,  "name": "John Doe",  "email": "john@example.com"}', {
        status: 200,
        headers: { 'Content-Type': 'application/json' }
      })
    );
  }
});