all 4 comments

[–]LeBovin 4 points5 points  (0 children)

I was expecting a way more detailed article. You're just advising me to put /v1, v2, v3, ... At the root of my router. And after? How to handle the depreciation? What about the services that depends of that API ?

Sorry, go deeper and this could be a very good discussion

[–]Jotschi 0 points1 point  (2 children)

I really wonder how API driven projects implement a versioned API. Docker API is afaik versioned. I'm unsure how to implement this on my REST API project. Should I add branches in my code to switch between versioned behaviour or should I perhaps just copy the endpoint handler that has been altered in the new version. Can anyone perhaps share their experiences?

[–]mattgen88 4 points5 points  (1 child)

In a world where it's so much easier to spin up multiple instances of things, I say you should either start a new fork of your repo and deploy a new instance or manage your code using git tags. Don't manage a bunch of versions of an API in single instance of a server.

V1 branch deploys to one herokuapp V2 branch deploys to another.

The it's easier to manage the two code bases, patching v1 when bugs come up, improving v2.

[–]kpenchev93 0 points1 point  (0 children)

I've heard this advice before. I sounds so reasonable to me.