cjskywalker
cjskywalker

Reputation: 3285

Loopback Rest API without connecting to database

I am planning to use some service from other SDK, but I don't know how to create a Rest API without having to connect to datasource. Currently, I have to create a remote hook inside a loopback database model which are not even relevant to each other. For example, I would like to call a Text Message Service API from Twilio, but I have to create the remote hook in Class Model since it's connected the database. Can I create a API without creating a model and connected to the datasource.

Upvotes: 3

Views: 639

Answers (1)

richardpringle
richardpringle

Reputation: 791

For using 3rd party REST APIs you can use a loopback-connector-rest datasource. The documentation for the connector can be found here.

Otherwise, you can create a model without connecting it to a datasource by setting it up in your model-config.json as follows:

"ModelName": {
  "datasource": null
}

Upvotes: 4

Related Questions