What is the best way to create an API using MVC3

I am using mvc3 and I want to create an API with a site.

MVC makes it easy to return json from a controller, which I know how to do.

I want to use a subdomain for api something like http://api.mydomain.com

I have a few questions

  • Create a scope for api or just put the controller and model in the root directory?
  • How can I point to a subdomain, so the api.mydomain.com url is not mydomain.com/api
  • What is the best way for api version? I just create a new controller for each version, for example. V1Controller, V2Contoller, etc. Etc.

Any suggestions would be really helpful.

thanks for the help

+3
source share
1 answer

I recently used ServiceStack, I really like working with it, you should look

http://www.servicestack.net/

+1
source

All Articles