Quick Answer
MirageJS is a client-side mock API library that intercepts fetch/XHR inside your JavaScript bundle. It is great when you want the mock to live with the app. Requex.me is a hosted mock API with a real public URL — it works from any language, from curl, from Postman, from CI. If you need your mock to be accessible outside the browser, Requex is the alternative.
MirageJS Alternative — Hosted Mock API
MirageJS pairs beautifully with React, Vue, and Ember. But the in-bundle design means your mock only exists in one place: your frontend dev server. Here is when to reach for a hosted alternative instead.
Where MirageJS Lives
MirageJS is a JavaScript library you import into your app. It hooks into fetch and XMLHttpRequest, and intercepts matching URLs to return mocked data. Routes, models, and serializers are defined in JavaScript:
import { createServer } from "miragejs"
createServer({
routes() {
this.get("/api/users", () => ({ users: [...] }))
this.post("/api/users", (schema, request) => {
// ...
})
},
})This is elegant when the mock lives in the app. But it only works for code running in that same JavaScript bundle. A backend test, a curl smoke check, a CI integration job, a mobile app — none of those can hit the Mirage mock.
MirageJS Pain Points
- Only works in JS bundles. Cannot mock for Python, Go, mobile, or CLI tools.
- Ships in production bundles. Easy to accidentally leave Mirage active in prod if the tree-shake config is wrong.
- Maintenance uncertainty. Mirage has slowed down — many teams are looking for alternatives.
- Can't share with backend devs. Your frontend teammate has a mock; your backend teammate has nothing.
- Breaks with SSR. Server-side rendering hits the real API, not Mirage.
Hosted Mock: What Changes
With a hosted mock API like Requex.me, the mock has a public HTTPS URL:
- Point
VITE_API_URLat the Requex URL in.env.development - Same mock is reachable from curl, Postman, mobile apps, CI
- Zero code in your bundle — no accidental production leakage
- Team shares one URL — frontend, backend, QA all see the same responses
- Works with SSR because the server can reach the public URL
Tradeoff: you lose the ability to write JS for dynamic responses. Requex compensates with conditional responses (return different bodies based on request shape) and template variables (echo request data back), but complex stateful mocks still need code.
Feature Comparison
| Feature | MirageJS | Requex.me |
|---|---|---|
| Where it runs | In JS bundle | Hosted URL |
| Accessible from backend/CLI/CI | No | Yes |
| SSR-compatible | No | Yes |
| Shareable with team | Via repo | Via URL |
| Dynamic JS responses | Yes | Template vars + conditions only |
| Auth simulation | Manual | Built-in |
| Bundle size impact | ~100kb | Zero |
When to Pick Which
Stay on MirageJS if:
- You want dynamic JavaScript-based mock logic with complex state
- Your mocks are tightly coupled to your frontend models
- You have unit tests that load the app and Mirage together
Switch to Requex if:
- Your backend team also needs access to the mock
- Integration tests run outside the browser (Playwright in CI, mobile, etc.)
- SSR is hitting real APIs and you need it to hit mocks
- Bundle size matters and Mirage is shipping to production
- You want auth simulation without writing it yourself
FAQ
Is MirageJS still maintained?
Activity has slowed. As of early 2026 the repo has fewer releases than in its peak. Evaluate the commit history before adopting it for long-term projects.
Can I use Requex with Next.js or Remix?
Yes — set your API URL env var to the Requex hosted URL in development. Server-side and client-side fetches both work.
How do I switch between mock and real API?
Use an environment variable. API_URL=https://requex.me/mock/... in dev, real URL in prod.