Description
FakeRest is a small browser library that fakes a REST API from JSON data. You give it your records, and it intercepts the AJAX calls your app makes, so a single-page app can run and be tested without a real backend. For collections, GET requests accept filter, sort, range and embed query parameters, and paginated lists return a 206 status with a Content-Range header. FakeRest does not intercept requests on its own. It plugs into one of three mocking libraries: MSW, which the authors recommend because requests show up in the browser dev tools network tab, fetch-mock, or Sinon.js, which handles XMLHttpRequest. The README has a short setup example for each. It is aimed at developers who test JavaScript REST clients on the client side, such as admin panels. The react-admin demo is built on it, and the project is open source on GitHub.…
Highlights
- Fake REST API from JSON data in the browser
- Filter, sort, range and embed query support
- Works with MSW, fetch-mock and Sinon
- Pagination with Content-Range headers
- Open source on GitHub
Ratings & Reviews
No ratings yet
Be the first to rate FakeRest.
People also visit
FakeRest FAQ
What does FakeRest do?
It intercepts fetch or XMLHttpRequest calls in the browser and answers them with records from a JSON data set, so you can work without a server.
Which mocking library should I use?
The README recommends MSW. FakeRest also supports fetch-mock and Sinon.
Does it support pagination and filtering?
Yes. Collection requests accept filter, sort, range and embed, and paginated responses return 206 with a Content-Range header.
Is it open source?
Yes. The source is on GitHub in the marmelab organization.
What are the best FakeRest alternatives?
Popular alternatives to FakeRest include Pocket Mocker, MockBolt and DummyJSON. See all FakeRest alternatives




