Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch from Chi to Gin web framework #79

Merged
merged 1 commit into from
Oct 1, 2024
Merged

Conversation

AmineAfia
Copy link
Collaborator

@AmineAfia AmineAfia commented Oct 1, 2024

TL;DR

Migrated the API from Chi to Gin framework and updated related components.

What changed?

  • Replaced Chi router with Gin in cmd/api.go
  • Updated API handlers to use Gin context
  • Modified middleware to work with Gin
  • Adjusted api.go to use Gin-compatible error handlers
  • Updated Meta struct to use uint64 for ChainId
  • Changed GetChainId function to return *big.Int
  • Removed api.go file from internal/handlers package

How to test?

  1. Run the API server
  2. Test all existing endpoints to ensure they work with the new Gin implementation
  3. Verify that authentication middleware still functions correctly
  4. Check that error handling and responses are consistent with the previous implementation

Why make this change?

The migration to Gin framework offers several benefits:

  • Improved performance and efficiency
  • Better support for middleware and routing
  • Enhanced request handling and parameter parsing
  • Simplified error management and response formatting

This change aims to streamline the API implementation and potentially improve overall application performance.

@AmineAfia AmineAfia requested a review from iuwqyir October 1, 2024 14:13
Copy link
Collaborator Author

AmineAfia commented Oct 1, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @AmineAfia and the rest of your teammates on Graphite Graphite

@AmineAfia AmineAfia marked this pull request as ready for review October 1, 2024 14:13
@AmineAfia AmineAfia changed the title Move api to use gin Switch from Chi to Gin web framework Oct 1, 2024
@AmineAfia AmineAfia mentioned this pull request Oct 1, 2024
@AmineAfia AmineAfia merged commit de8ab92 into main Oct 1, 2024
4 checks passed
@AmineAfia AmineAfia deleted the 10-01-move_api_to_use_gin branch October 1, 2024 15:42
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.

2 participants