1

I have a cloudantDB server and database on it. On my js file, I create IBMCloudCode to call cloudantAPI.

js file:

app.value('IBM_CREDENTIALS',{
    APP_ROUTE: 'http://myserver.cloudant.com'
})
.factory('IBMService',['$http','IBM_CREDENTIALS', '$window',function($http,IBM_CREDENTIALS, $window){
    var config = {
      //  applicationId:IBM_CREDENTIALS.APP_ID,
        applicationRoute:IBM_CREDENTIALS.APP_ROUTE,
      //  applicationSecret:IBM_CREDENTIALS.APP_SECRET
    };

    IBMBluemix.initialize(config);
    var ibmCC = IBMCloudCode.initializeService();

    return {
        getProviderById:function(providerId){
          return ibmCC.get("/provider/_all_docs?key="ABC123"&include_docs=true");
        }

    }
}]);

But when debug to get API I have a error message : "IBMBluemix.getConfig(...).getBaaSURL is not a function". Please help me to review and give me your thoughts. Thanks!

1 Answer 1

1

According to npm, IBM Cloud Code is currently deprecated.

The corresponding backend services on Bluemix have been completely removed, so CloudCode will not work as expected.

If you continue to have issues, I suggest using something like the Request library to send simple REST requests.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for sharing..:)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.