diff --git a/.npmignore b/.npmignore index 7ec7473..1ea835e 100644 --- a/.npmignore +++ b/.npmignore @@ -14,3 +14,7 @@ node_modules coverage *.tgz *.xml +test +.travis.yml +test +.travis.yml diff --git a/README.md b/README.md index 85d226d..a2ad2a4 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,9 @@ Remote REST API connector for [loopback-datasource-juggler](https://github.com/strongloop/loopback-datasource-juggler). +- The version range 2.x is compatible with LoopBack v3 and newer. +- Use the older range 1.x for applications using LoopBack v2. + ## Quick Explanation Use this connector to create a datasource from another Loopback application. Below is a quick example: @@ -13,26 +16,26 @@ Use this connector to create a datasource from another Loopback application. Be "connector": "remote" } ``` -Note that you should add a `url` property to point to another remote service. +Note that you should add a `url` property to point to another remote service. If you do not specify a `url` property, the remote connector will point to it's own host name, port it's running on, etc. -The connector will generate models on the MyMicroService datasource object based on the models/methods exposed from the remote service. Those models will have methods attached that are -from the model's remote methods. So if you exposed a remote method from that micro-service called `bar` from the model `foo`, +The connector will generate models on the MyMicroService datasource object based on the models/methods exposed from the remote service. Those models will have methods attached that are +from the model's remote methods. So if you exposed a remote method from that micro-service called `bar` from the model `foo`, the connector will automatically generate the following: `app.datasources.MyMicroService.models.foo.bar()` ### Access it in any model file -To access the remote Loopback service in a model: +To access the remote Loopback service in a model: ```javascript module.exports = function(Message) { Message.test = function (cb) { Message.app.datasources.MyMicroService.models.SomeModel.remoteMethodNameHere(function () {}); - + cb(null, {}); }; - + }; ``` diff --git a/package.json b/package.json index 888ba8d..92638b2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,7 @@ { "name": "loopback-connector-remote", - "version": "1.3.2", + "version": "2.0.0-alpha.1", + "pubishConfig": { "tag": "next" }, "description": "Remote REST API connector for Loopback", "main": "index.js", "keywords": [