4

So most restful services it seems have version whether it be in the URL, headers, or what have you, now how do you manage these routes on the server side?

The real question is how do you take the request and and make sure it gets pointed to the correct controller version.

My question is specific to .net mvc webapi but I suppose the solution will be generic enough for any language

tereško
  • 58,060
  • 25
  • 98
  • 150
dbarnes
  • 1,803
  • 3
  • 17
  • 31

2 Answers2

2

Mike Wasson wrote a blog piece on how to implement versioning in your Web API using namespaces. You can find the blog post here.

ardila
  • 1,277
  • 1
  • 13
  • 24
Jon Susiak
  • 4,948
  • 1
  • 30
  • 38
0

I use symfony2 and have a routing file that redirects to the given Controller. E.g. the /v1/ has a set for all routes regarding the v1. If i have a v2 i will use e.g. the v2 file to the new Controllers. With that i use some tools for manage the data output.

Sadly i dont know how to implement that in .net. but i think you could create a config for your routing.

develth
  • 771
  • 8
  • 32