| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
| |
- Enhanced the `add` method to handle parameterized routes (e.g., `/test/:name`) by converting `:param` into regex groups.
- Updated the `route` method to extract and store route parameters in the `parameters` property.
- Added logic to match parameterized routes and pass extracted parameters to handlers.
- Included a fallback for 404 responses when no route matches.
This update allows handlers to access dynamic route parameters via `router.parameters`.
|
| |
|
|
|
|
|
|
|
| |
normalization
- Added error handling for unexpected exceptions in the `route` method, returning a 500 response with a descriptive error message.
- Normalized paths in the `route` method to ensure consistent matching by removing trailing slashes.
- Improved the 404 response to include the unmatched path for better debugging.
- Enhanced code comments for clarity and maintainability.
|
| |
|
|
|
|
|
|
| |
- Normalized URL path by removing trailing slashes for consistent matching.
- Added proper 404 response when a route is not found, including the requested path in the error message.
- Enhanced error handling to return a 500 Internal Server Error for unexpected exceptions.
- Prepared for potential optimization by suggesting the use of a `Map` for faster route lookups.
- Improved code readability and maintainability.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
|