In Memory Web Api

screenshot of In Memory Web Api

The code for this project has moved to the angular/angular repo. This repo is now archived.

Overview

The Angular in-memory-web-api is an essential tool for developers working with Angular applications, especially when it comes to testing and demoing CRUD operations. This library provides a simple way to simulate a RESTful API by intercepting HTTP requests that would typically go to a remote server and redirecting them to a controllable in-memory data store. It's ideal for rapid prototyping and making development easier without the overhead of setting up a real server.

With its focus on performance and ease of use, the in-memory-web-api acts as a temporary solution that facilitates data persistence during app development. Whether you’re building unit tests or demonstrating functionality, this tool allows you to simulate various operations against a dataset, all while ensuring that your actual database remains untouched during the testing phase.

Features

  • Easy CRUD Simulation: Easily emulate Create, Read, Update, and Delete operations without the need for a live server, making it perfect for demos and tests.
  • Intercepts HTTP Requests: Automatically intercepts Angular Http and HttpClient requests, redirecting them to an in-memory data store for controlled testing.
  • Customizable Data Store: Allows developers to define collections and the associated data, offering flexibility in how data is handled during tests.
  • Reset for Each Test: The in-memory data store resets with every test, ensuring that there is no cross-test data pollution, leading to more reliable testing outcomes.
  • Integrates with CI: Supports continuous integration builds by providing an isolated testing environment, preventing any disturbances to the actual database.
  • Asynchronous Initialization: Supports asynchronous methods for initializing the in-memory database service with a JSON file, making it versatile for different data structures.
  • Primarily for Development: This tool is specifically designed for development and testing purposes, ensuring that it does not intend to replace a production database. It’s always experimental and subject to changes.
gulp
Gulp

Gulp.js is an old but popular site building tool that automates various repetitive development tasks in web development, such as compiling Sass, minifying JavaScript, and optimizing images.

rollup
Rollup

RollupJS is a popular and efficient JavaScript module bundler that takes the code from multiple modules and packages them into a single optimized file, minimizing the overall size of the application and improving its performance.

typescript
Typescript

TypeScript is a superset of JavaScript, providing optional static typing, classes, interfaces, and other features that help developers write more maintainable and scalable code. TypeScript's static typing system can catch errors at compile-time, making it easier to build and maintain large applications.

webpack
Webpack

Webpack is a popular open-source module bundler for JavaScript applications that bundles and optimizes the code and its dependencies for production-ready deployment. It can also be used to transform other types of assets such as CSS, images, and fonts.