Skip to content

Fix#215 API versioning#270

Merged
aji70 merged 2 commits intoMyFanss:mainfrom
iGEORGE17:fix#215
Feb 26, 2026
Merged

Fix#215 API versioning#270
aji70 merged 2 commits intoMyFanss:mainfrom
iGEORGE17:fix#215

Conversation

@iGEORGE17
Copy link
Contributor

Summary

Introduces URL-based API versioning by routing all existing endpoints under /v1/. Unversioned paths issue a 301 Moved Permanently redirect to their /v1/ counterpart, preserving backward compatibility for existing clients.


Changes

Core

  • Enabled VersioningType.URI with defaultVersion: '1' in main.ts

Controllers

  • Updated all controllers — @Controller({ path: '', version: '1' })

Docs

  • Added VERSIONING.md with migration guide and instructions for adding future versions

Endpoint Mapping

Old New Status
GET /creators GET /v1/creators 301 redirect
GET /creators/:id GET /v1/creators/:id 301 redirect
POST /creators POST /v1/creators 301 redirect
PUT /creators/:id PUT /v1/creators/:id 301 redirect
DELETE /creators/:id DELETE /v1/creators/:id 301 redirect
GET /users GET /v1/users 301 redirect
GET /users/:id GET /v1/users/:id 301 redirect
POST /users POST /v1/users 301 redirect
PUT /users/:id PUT /v1/users/:id 301 redirect
DELETE /users/:id DELETE /v1/users/:id 301 redirect

How to Add a Future Version

No changes to v1 are required. Create a new controller with version: '2' and register it in the module:

@Controller({ path: 'creators', version: '2' })
export class CreatorsV2Controller { ... }

Closes #215

Copy link
Contributor

@aji70 aji70 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lfg

@aji70 aji70 merged commit e4fe077 into MyFanss:main Feb 26, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

API versioning (e.g. /v1/...)

2 participants