A Node.js server for building configurable fake backends using JSON files or JavaScript objects.
http-fake-backend is a Node.js server that allows developers to create fake backends by serving content from JSON files or JavaScript objects through configurable routes. It solves the problem of frontend development and testing being blocked by unavailable or incomplete real backends. The tool provides a flexible way to mock API endpoints, simulate HTTP statuses, and serve various content types.
Frontend developers, QA engineers, and full-stack developers who need to mock APIs for testing, development, or prototyping without relying on a live backend.
Developers choose http-fake-backend over alternatives like JSON Server because it offers greater flexibility in configuring routes, simulating HTTP errors, and serving multiple content types, all while being easy to set up and integrate into development workflows.
Build a fake backend by providing the content of JSON files or JavaScript objects through configurable routes.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Supports defining endpoints with parameters, HTTP methods, and variable path segments like '/update/{id}', allowing complex routing beyond basic CRUD.
Can serve JSON, HTML, text, PDFs, and send files directly with customizable MIME types, as shown in the fileTypes example configuration.
Integrates with boom to simulate HTTP status codes and errors, enabling detailed error handling tests for frontend development.
Offers hot-reload via nodemon during development and a Yeoman generator for rapid endpoint setup, speeding up mock creation.
The project is officially unmaintained, with only a final bug fix release for Node 18, meaning no security updates, new features, or community support.
Requires manual creation of configuration files for each endpoint, which can be verbose and time-consuming compared to simpler tools like JSON Server.
Built on hapi, which may have a steeper learning curve and less ecosystem adoption than alternatives like Express, limiting flexibility and resources.
http-fake-backend is an open-source alternative to the following products: