Hello,
I see in the example suggested, a rest datasource using rest connector is called within a remoteMethod nearby.
I am looking to do something different.
I am looking to either in
/common/some_rest_service
or
/server/some_rest_service
have a bunch of model files using the rest connector as an endpoint. Basically I want to make a rest client within the model layer, NOT the rest api layer.
so my questions are,
suppose I have /common/models/myloopbackmodel.js
however in the "some_rest_service", there is also a model nammed myloopbackmodel
so I want to have
/common/models/myloopbackmodel.js (PersistentModel using mongodb datasource)
AND
/common/some_rest_service/myloopbackmodel.js ( ?? using rest datasource)
1.) How can I have app.models basically have a namespace for this?
2.) would the object inside model-config.json have to contain both and have unique name?
"myloopbackmodel": {
"dataSource": "mongodb",
"public": false
},
"myloopbackmodel": {
"dataSource": "some_rest_service",
"public": true
},