Skip to content

fix: Refactor track endpoint to consolidate routes#26

Merged
dev-bre merged 1 commit intomainfrom
fix-track-endpoint
Dec 4, 2025
Merged

fix: Refactor track endpoint to consolidate routes#26
dev-bre merged 1 commit intomainfrom
fix-track-endpoint

Conversation

@dev-bre
Copy link
Contributor

@dev-bre dev-bre commented Dec 4, 2025

This pull request simplifies the routing logic for the /track and /api/track endpoints in internal/server/routes.go, making the code cleaner and preventing issues with trailing slash redirects. The main change is the removal of grouped routes in favor of direct route registration.

Routing improvements:

  • Replaced grouped route registration for /track and /api/track with direct POST route handlers, eliminating unnecessary route groups and preventing trailing slash redirect issues.
  • Reused a single instance of EventHandler for both endpoints, reducing redundant object creation.… slash redirects

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

Related Issue

Closes #(issue number)

How Has This Been Tested?

Describe the tests you ran and how to reproduce them.

Screenshots (if applicable)

Add screenshots to help explain your changes.

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

@dev-bre dev-bre merged commit 736efc9 into main Dec 4, 2025
2 checks passed
@dev-bre dev-bre deleted the fix-track-endpoint branch December 4, 2025 08:27
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.

1 participant