I am using mvc3 and I want to create an API with the site.
MVC makes it really easy to return json from the controller which I know how to do.
I want to use a subdomain for the api something like http://api.mydomain.com
I have a few questions
- Do I create an area for api or just place the controller and model in the root?
- How can I point to the subdomain so the url is api.mydomain.com not mydomain.com/api
- What is the best way to version the api? do I just create a new controller for each version e.g. V1Controller,V2Contoller etc etc
Any suggestions would be really helpful.
Thanks for your help
I have recently used ServiceStack, I really like working with it, you should take a look
http://www.servicestack.net/