Connecting models to datasources

The next step is to make a relationship between models and datasources, for this we will edit the file manually.

Remember that the command line also offers this feature with slc loopback:relation: however, at the time of writing, there is a bug in the generator and we cannot use this feature at the moment. However, this does not prevent us from continuing with our application, since the command-line tool is not mandatory:

Open server/model-config.json and add the following highlighted code:

 { "_meta": { "sources": [ "loopback/common/models", "loopback/server/models", "../common/models", "./models" ], "mixins": [ "loopback/common/mixins", "loopback/server/mixins", "../common/mixins", "./mixins" ] }, "motorcycle": ...

Get Node.js 6.x Blueprints now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.