Scraping Mocks from your Backend

Option 1: Browser Extension

The companion Chrome devtools extension lets you download all the HTTP responses and save them in bulk following Mockaton’s filename convention.

Option 2: Fallback to your Backend

This option could be a bit elaborate if your backend uses third-party authentication, because you’d have to manually inject cookies or sessionStorage tokens.

On the other hand, proxying to your backend is straightforward if your backend handles the session cookie, or if you can develop without auth.

Either way you can forward requests to your backend for routes you don’t have mocks for, or routes that have the ☁️ Cloud Checkbox checked. In addition, by checking ✅ Save Mocks, you can collect the responses that hit your backend. They will be saved in your config.mocksDir following the filename convention.