Rajan Prasad
Rajan Prasad

Reputation: 1679

How to host an API on Azure Mobile Apps

I have scourged through the internet and through MSDN sites to find out a simple example to host an API on Azure mobile apps. I partially understand what are Controllers, but I do not know how to map the url addresses to the controller.

For example, if my baseUrl is http://{my_site_address}/{my_site_name} and I want to add an API named get_next_post, how do I map this API to the controller such that baseUrl/get_next_post calls the Post or Get method of that controller.

Once I know this, I can write more such API's and map them to controllers similarly.

Is there a concrete documentation on this? The Azure MSDN pages keep talking about offline data sync, push notifications etc but they don't talk about how to simply host an API.

Upvotes: 1

Views: 49

Answers (1)

Rajan Prasad
Rajan Prasad

Reputation: 1679

I found a really informative article here Custom HTTP Endpoints. I am surprised that none of the Azure documentation pages and videos mentioned that the custom Controller name specifies the baseUrl/api/{api_name}, as mentioned in the article.

Upvotes: 1

Related Questions