Domain routing in Waaseyaa: replacing a giant dispatcher with small routers
php
dev.to
Ahnii! Waaseyaa had a controller dispatcher that grew past 1,000 lines. Every new feature meant more conditionals in the same file. This post covers how that dispatcher was replaced with domain-specific routers, each implementing a two-method interface that keeps routing logic scoped and testable. What a Dispatcher Does graph TD A[HTTP Request] --> B[Router] B -->|matches URL to route| C[Dispatcher] C -->|picks controller, injects context| D[Controller] D --> E[Re