Skip to content

Refactor request handling to use Router class from relic package #4101

Closed

Description

@coderabbitai

Description

The current server implementation uses manual path and HTTP verb dispatch. This should be refactored to use the Router class from the relic package for better maintainability and extensibility.

Affected Files

  • packages/serverpod/lib/src/server/server.dart:190

Context

// TODO: Use Router instead of manual dispatch on path and verb
if (uri.path == '/') {
  // Perform health checks
  ...
}

Suggested Implementation

  • Use the Router class from the relic package (already a dependency)
  • Implement route matching and dispatching logic using relic's Router API
  • Migrate existing manual dispatch code to use Router
  • Add support for route parameters and pattern matching as provided by relic
  • Maintain backward compatibility during transition
  • Add tests for route matching edge cases

Impact

Code maintainability, extensibility for adding new routes, better error handling

Related

Activity

  1. added
    enhancement
    on Oct 27, 2025
  2. moved this from Inbox 📫 to Planned 🔭 in Serverpod Frameworkson Oct 30, 2025
  3. moved this from Planned 🔭 to Next Up 🎯 in Serverpod Frameworkson Oct 30, 2025
  4. added
    area: web server
    on Oct 30, 2025
  5. self-assigned this
    on Oct 30, 2025
  6. moved this from Next Up 🎯 to In Progress 🔥 in Serverpod Frameworkson Oct 30, 2025
  7. linked a pull request that will close this issuerefactor: Use RelicApp in Server #4134on Nov 6, 2025
  8. moved this from In Progress 🔥 to Done 🚀 in Serverpod Frameworkson Nov 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area: web serverenhancement

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions