I am finishing the API of our web service. Now Iβm thinking about how to change the route, so if we decide to create a new version, we wonβt break the first API.
right now:
url: /api/:action param: { module: api, action: :action } requirements: sf_format: (?:xml|json)
what i thought:
url: /api/v1/:module/:action param: { module: api1, action: :action } requirements: sf_format: (?:xml|json) url: /api/v2/:module/:action param: { module: api2, action: :action } requirements: sf_format: (?:xml|json)
Itβs easy, but the ideal solution would be to have the following view of the route
# Automatically redirects to one module or another url: /api/v:version/:module/:action param: { module: api:version, action: :action } requirements: sf_format: (?:xml|json)
any ideas on how to do this? What did you recommend to us?
thanks!
fesja source share