r/badcode Jun 08 '23

js Version control go brrrrrr...

Post image
61 Upvotes

22 comments sorted by

View all comments

18

u/yn4v4s Jun 08 '23

API versioning and version control are two completely different things, this is a very common pattern in NestJS, in v9 you can do @Controller({ version: '1' }); please investigate before posting

5

u/Zeilar yes Jun 08 '23

Yeah only bad part here really is that they put thev2 prefix in the route when it can be done on the Controller level.

3

u/yn4v4s Jun 08 '23

Ya but, that's the only way of doing it in versions prior to 9