Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Can someone explain to me please how this is handled within the internal codebase. I assume that it's not a lot of if statements or copying whole API directories with every release but something much simpler? Thanks! :)


There's multiple of ways of doing this but let's assume some sort of routing model is used so you can have global rules based on the version provided that redirects/executes (depending on the layer where these rules are enforced) the proper code. From a code standpoint it can mean having a separate route group in your code for an API version, or it means that you have multiple routes for the "same" functionality per specified version, or it can mean something else entirely depending on how your code is structured. They most definitely aren't copy pasting parts of their project to support this.


Author here. We plan to publish a blog post in the next few months that explains how we do this under the hood. We have some pretty nice abstractions and tooling to make it as maintainable as possible.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: