aboutsummaryrefslogtreecommitdiff
path: root/source/library/router.js
Commit message (Collapse)AuthorAgeFilesLines
* feat(router): improve Router class with enhanced error handling and path ↵Alex2025-03-231-20/+30
| | | | | | | | | 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.
* Refactor `route` function for improved performance and error handlingAlex2025-03-231-7/+19
| | | | | | | | - 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.
* refactor: implement Router class for improved request handlingAlex2025-03-231-0/+67