Reputation: 13892
I have an Azure Web App running, which has custom Easy APIs defined and a few Easy Tables. I have been using this Azure Web App and the SQL tables connected to it to run a few javascript-based LOB Windows Store apps the past year and it has worked really well.
But now I need to access these resources for a Node.js process I'll be running locally. I'd like to access it in pretty much the same way I access it in my Windows Store app:
var client = new window.WindowsAzure.MobileServiceClient(
"https://my-mobileservice.azure-mobile.net/",
"MOBILESERVICEKEY"
);
If I can't access the Web App using the same API as provided above from within Node, it will suffice if I can just read and write rows to the SQL tables manually.
So how can I do this?
Upvotes: 1
Views: 334
Reputation: 13918
The code snippet you provided was using Azure Mobile Apps client SDK, which is for devices or browsers.
In your other node.js application, you can consider to implement HTTP requests against your Easy Tables and Easy APIs scripts. As Azure Mobile Apps service has exposed them as RESTful APIs. You can refer to https://azure.microsoft.com/en-us/documentation/articles/app-service-mobile-node-backend-how-to-use-server-sdk/#TableOperations for more info.
And you can refer to the following code snippet for your information.
var request = require("request");
request({
method:'GET',
url:'https://<your_mobile_app>.azurewebsites.net/tables/TodoItem',
headers:{
'ZUMO-API-VERSION':'2.0.0'
}
},(err,res,body)=>{
console.log(body);
})
Upvotes: 1