LoopBack supports a number of connectors to backend systems beyond databases.
Page Contents

These types of connectors often implement specific methods depending on the underlying system. For example, the REST connector delegates calls to REST APIs while the Push connector integrates with iOS and Android push notification services. 

Models attached to non-database data sources can serve as controllers (a model class that only has methods). Such models usually don’t have property definitions as the backing connector doesn’t support CRUD operations. For example, to define a model for an external REST API, we can have a model as follows:

common/models/my-rest-service.json

{
  "name": "MyRestService",
  "base": "Model",
  "properties": {},
  "validations": [],
  "relations": {},
  "acls": [],
  "methods": []
}

The model is configured to attach to the REST data source.

server/model-config.json

...
  "MyRestService": {
    "dataSource": "myRestDataSource",
    "public": true
  }
...

Available connectors

Officially-supported non-database connectors include:

Tags: data_sources