I am kind of new to pylons and I have the task of designing a API versioning system. I want to store the different versions of the APIs in different folders. For example:
controllers/APIVersion/v1/clientAPI.py -- Version 1
controllers/APIVersion/v2/clientAPI.py -- Version 2
controllers/APIVersion/v3/clientAPI.py -- Version 3
The requests to get to these APIs should look like this:
curl 'http://mySite/v1/clientAPI/get/' -- Should bring me to the first version
curl 'http://mySite/v2/clientAPI/get/' -- Should bring me to the second version
I know I can do this through routing.py. This was my first idea that didn't seem to work:
map.connect('/APIVersion/{version}/{controller}/{action}')
Any ideas on how to route to the desired location? Also, feel free to comment on my versioning approach. I welcome the advice.