1.0.0-ng11 • Published 1 year ago

ngx-backend-mocker v1.0.0-ng11

Weekly downloads
-
License
-
Repository
-
Last release
1 year ago

ngx-backend-mocker

This package helps to mock apis for angular components, per end-point and depending on the request.

To use the package, you will install it using npm, and add the NgBackendMockerModule, to your angular app. Then you will implement IBackendMockDataProvider which basically is just supposed to return an array of ResponseCheckPoint objects. Each ResponseCheckPoint by defines a response for a response.

By default, ResponseCheckPoint objects will respond to requests matching their uri and http method. but this can be customized and you can put your own logic to determine whether to respond or not to a request by assigning a (HttpRequest,ResponseCheckPoint) => boolean method to the requestSelector property of ResponseCheckPoint.

For more details and examples please checkout The github page