After reading and watching some of the stuff coming out from Apigee about API Design, I've been convinced that APIs should probably be versioned in the URL using a scheme like this:
By the time I realized this the API I had been building with node.js was basically already complete, so I was a little bit sad that I'd have to come up with some complicated versioning scheme.
After a bit of fretting I realized that express can handle this super easy using an interesting feature of the express() instance that it can be mounted to another route using app.use().
This means that your routes don't know which version they are!
Here's your main app file.
Then you'll put each version of your API in the routes/ folder named after the version.
Each version of the API can have middleware (such as unique authentication) that only works on that version of the API.
One thing that this doesn't cover is unique models per version, but I'll leave that up to you to figure out how to accomplish, because the needs of each app very quite a bit by app.
Hope this tip helps!
I really appreciate information shared above. It’s of great help. If someone want to learn Online (Virtual) instructor lead live training in Apigee , kindly contact us http://www.maxmunus.com/contactReplyDelete
MaxMunus Offer World Class Virtual Instructor led training on TECHNOLOGY. We have industry expert trainer. We provide Training Material and Software Support. MaxMunus has successfully conducted 100000+ trainings in India, USA, UK, Australlia, Switzerland, Qatar, Saudi Arabia, Bangladesh, Bahrain and UAE etc.
For Demo Contact us.
Skype id: training_maxmunus
Ph:(0) 9738075708 / 080 - 41103383
• Email addresses will be provided for all staff via a cloud provider (such as Google Apps for Business or Microsoft Office 365). http://lf9h5bhdv1.dip.jp http://x4ehpyd26y.dip.jp http://86i7efx2at.dip.jpReplyDelete
Nice post. It is really interesting. Thanks for sharing the post!
Fridge Online Shopping | Refrigerator Online Shopping
Refrigerator Price Online | Online Fridge Price
Washing Machine Sale | Washing Machine Online Offers
Mobile Phone Offers Online | Buy Mobile Online
Sathya Online Shopping
Web property is properly designed in a friendly way Thanks For Sharing Beautiful Memories!ReplyDelete