A browser library that intercepts AJAX calls to mock a REST server based on JSON data for client-side testing.
FakeRest is a browser library that intercepts AJAX calls to mock a REST API server based on JSON data. It allows developers to test JavaScript REST clients, such as single-page applications, without requiring a real backend server by faking HTTP requests and responses. The library supports full CRUD operations, advanced querying, and middleware for simulating server-side logic.
Frontend and full-stack developers building and testing REST client applications, particularly those working on single-page apps who need to mock API responses during development or testing.
Developers choose FakeRest for its seamless integration with popular mocking libraries like MSW, fetch-mock, and Sinon.js, its realistic simulation of REST API behaviors including filtering and embedding, and its flexible middleware system for custom server logic.
Patch fetch/XMLHttpRequest to fake a REST API server in the browser, based on JSON data.
Supports full CRUD operations, advanced filtering with operators like _gt and _lte, and embedding of related resources, mimicking a real backend with detailed query parameters.
Provides adapters for MSW, fetch-mock, and Sinon.js, allowing seamless integration with popular mocking setups in JavaScript projects, as shown in the README examples.
Enables simulation of server-side behaviors such as authentication checks, validation, and response delays through a chainable middleware API, with built-in functions like withDelay.
Allows customization of identifier fields (e.g., for MongoDB) and primary key generation via options like identifierName and getNewId, adapting to various API structures.
Patches browser APIs like fetch and XMLHttpRequest, making it unsuitable for server-side testing, Node.js environments, or projects requiring mock servers outside the browser.
Requires installation and setup of third-party libraries like MSW or Sinon, adding complexity and maintenance compared to all-in-one solutions that work out of the box.
Mock data is stored in memory and lost on page refresh, which can be inconvenient for long-running development sessions or demos needing persistent state without extra setup.
Get a full fake REST API with zero coding in less than 30 seconds (seriously)
Development tool to mock API endpoints quickly and easily - NOT MAINTAINED
HTTP requests collector to test webhooks, notifications, REST clients and more ...
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.