3. - New database architecture
- iOS builds are not so easy to change
- Old iOS build should be supported as well as new versions
Why did we initiate API versioning?
5. - New features should be implemented into API V2
- API V1 shouldn’t know about database changes
- API V1 will not be updated with new features
ExpressJS: API versioning
requirements
6. ExpressJS: API versioning
new flow to fit requirements
request
middlewares
response
controller V1
model
route V1
route V2 controller V2
response service
(mapper)
7. ExpressJS: API versioning
new flow to fit requirements - response mapper
origin url?response data process response
emulate v1 response
(map)
response service / mapper
/api/v1
/api/v2
8. - Create V1 and V2 routes
- Move previous controller actions to V2 folder (controllers/v2)
- Leave entities that should be changed in V1
- Convert / Migrate existing data to get it suitable with new database
structure
ExpressJS: API versioning
new flow to fit requirements