RESTApps makes it possible to create custom REST endpoints in SiteVision. This enables flexible Headless CMS implementations based on SiteVision. RESTApps also offer a powerful yet simple way to enrich SiteVision websites with new methods to expose data, as well as new methods to create and manage content.
Development of a RESTApp takes place outside of SiteVision in a code editor of choice. RESTApps and WebApps have a lot in common when it comes to development and deployment.
RESTApps and WebApps is based on the same technology, their API:s are very similar and the development process is likely the same. There are some profound differences though:
RESTApps can be used to effectively diminish the latency and overhead that lots of http calls to the SiteVision Model REST API would have.
For instance, to update a sv:simpleUser you typically do a http PUT request to the simpleuser endpoint with data and get the result of the operation back. Hence, to update three users you must do three http requests and so on. The http latency and overhead cost is linear. RESTApps can be used to almost completely get rid of such additional linear costs.
The receipe is to create a RESTApp that receives a single request (with data for multiple REST invocations) and then let the RESTApp split the data up, execute the SiteVision Model REST API, server-side - multiple times. The RESTApp then returns a response with the result of all REST invocations. This aggregating facade-approach is typically implemented using the requireable RestApi utility of the SiteVision API. It has a single latency and minimal http overhead cost.
Use the RestApi utility to execute server-side invocations of the SiteVision Model REST API.