I'm working on an API in Flask and one of the requirement is to keep multiple versions so end users will have the ability to switch between versions. I've started to maintain multiple version code bases based on recommendation(or answer) from this thread, but my question is, is there anyway to route user to hit different API versions just based on the parameter they pass in without actually changing url on their end.
For example:
http://testapp.com/api?v=1.0
will route to
http://testapp.com/1.0/api
and
http://testapp.com/api?v=2.0
will route to
http://testapp.com/2.0/api
I understand that using redirect(url_for('###'))
with registered blueprint probably could solve this, but not ideal in my case(I'd like to keep the same url without redirecting but rendering the response from different version of api accordingly into current request)
Apologize in advance if my writing is not clear.