Services
The services are responsible for consuming data from the servers and are very important for the business logic of the application
Services Structure
In theapp/ folder there are a series of documents that are preconfigured and ready to be extended. Among these we have some that are intended for the creation of our services.
If theservicein question is not going to answer aCRUDit is possible to extend only fromHttpand have access only to the methods referring toHTTPverbs.

A service created to solve basic operations will extend fromRestand will have a syntax similar to the image below.

Http
HttpThe Http class is the basis for Rest and is an abstraction of an HTTP client. By default it will use theaxiosthat is created insrc/settings/http.js, which uses the value of the.env VUE_APP_REST_BASE_URL entry asbaseURL.
Rest
RestTo supply the 4 pillars of the management of the entities, it already has thecreate, read, update and destroy methods, as well as thesearch/paginate paginate method to deal with data search and pagination.

Last updated
Was this helpful?