Skip to content

FEAT: add base HTTP controller and routes structure#506

Open
GabrielTozatti wants to merge 2 commits intotzt/feat/utxo-worker-schema-servicefrom
tzt/feat/utxo-worker-gasless-http-controller
Open

FEAT: add base HTTP controller and routes structure#506
GabrielTozatti wants to merge 2 commits intotzt/feat/utxo-worker-schema-servicefrom
tzt/feat/utxo-worker-gasless-http-controller

Conversation

@GabrielTozatti
Copy link
Contributor

Description

Creates the base HTTP structure for the Worker, introducing controllers, routes and error handling middleware following a modular pattern that scales for future domains.

Summary

  • Created src/http/ structure separating HTTP concerns from queues/jobs
  • Created controller with reserve (test) endpoints
  • Created routers mapping /worker/gasless/* routes
  • Created handleErrors global error handling middleware with AppError
  • Created setupRoutes() to register all routers in the Express app
  • Registered setupRoutes(app) in worker entrypoint

Checklist

  • I reviewed my PR code before submitting
  • I ensured that the implementation is working correctly and did not impact other parts of the app
  • I mentioned the PR link in the task

Copy link
Member

@guimroque guimroque left a comment

Choose a reason for hiding this comment

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

Code Review

Summary

Solid foundation for HTTP structure with proper separation of concerns and error handling. The modular approach with controllers, routes, and middleware follows good architectural patterns. However, there are critical issues with console.log usage and missing Express middleware setup.

Strengths

  • Clean modular structure separating HTTP concerns in src/http/ directory
  • Proper error handling with custom AppError class and centralized middleware in handleErrors.ts:10-22
  • Good separation of routes and controllers in gasless/routes.ts:5-6 and gasless/controller.ts:4-15
  • Consistent async/await pattern with proper error propagation in controller.ts:9-13

Issues

  • 1 critical, 1 important, 0 suggestions

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