Extensibility and versioning
We've already defined a few basic versioning rules in Chapter 3, Building a Typical Web API. Let's apply them to the test API version implemented in the previous chapter. Our starting point would be to enable the current consumers of the API to continue using the same version on different URIs. This would keep them backward compatible until they test and adopt the new version.
Keeping a REST API stable is not a question of only moving one endpoint from one URI to another. It doesn't make sense to perform redirection and afterwards have an API that behaves differently. Thus, we need to ensure that the behavior of the moved endpoint stays the same, as it has been at the previous location. To ensure that we don't change the previously implemented behavior, let's keep the current behavior from contactdataservice.js
module to a new module by renaming the file to contactdataservice_1.js
. Then make a copy of it to a module contactdataservice_2...