Skip to content

Conversation

@splashsky
Copy link
Owner

Aloha! With some inspiration from FOMO and other projects, I wanted to look into some improvements to the router. Simplicity, after all, is a hallmark for good engineering!

That being said, this is a completely breaking change to the router. The function names themselves and it's use is mostly the same, but I completely got rid of the static functionality in favor of a traditional class.

  • The class is no longer static - needs to be initiated (the constructor now takes the basePath) and that instance used
  • Added the missing HTTP verbs (PUT, PATCH, DELETE)
  • Removed adding a path with multiple verbs at once, may reintroduce in the future
  • Removed "method not allowed" endpoint, as a mismatched route and method is still more or less a 404 by definition
  • Greatly simplified the internal structure of the router, such that even adding support for the 3 new verbs we've reduced LOC by about 70 lines

Just waiting to perform some real world-testing to see if there are other improvements to be made.

@splashsky splashsky self-assigned this Mar 10, 2023
@splashsky splashsky added the enhancement New feature or request label Mar 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants