ngx-reverse-rest
The Angular REST library that thinks differently.
Leightweight, fully tested and as flexible as it could be (with DI in its heart).
What it is about
Terms:
- REST Service - an Angular service that performs the communication with the REST endpoint
- DTO (Data Transfer Object) - a class that represents a data being sent (similar to gRPC message)
Most of the REST libraries in the wild look at the communication with REST endpoints from services prospective. Every endpoint gets a corresponding Angular service. Every service sends / receives the DTOs.
This library attempts to reverse this idea. Mostly, while developing, one does not care about the different REST services. One cares about the DTOs, so here the DTO holds all information that is required for getting / sending this DTO.
Installation
npm i ngx-reverse-rest
Usage
1. Add module to the app.module.ts
imports:
2. BackendService
Create a REST Service that will be (most likely) the only one you have:
;;;;
3. Describe your entities
For each of your DTOs add the endpoint describing where you get them from / send them to:
;
Here the users could be received from different endpoints.
4. Send and receive
See app.component.ts in this project:
;;
License
MIT