Feat: register routers - #18
Open
AxiosLeo wants to merge 5 commits into
Open
Conversation
- Introduced a new `normalizeRouter` function to standardize router objects, ensuring consistent handling of prefixes, methods, and handlers. - Added `registerRouters` function to facilitate dynamic registration of routers into the route tree, improving flexibility in route management. - Updated `resolveRouters` to utilize the new `registerRouters` function for cleaner implementation.
- Added the `registerRouters` function to `index.js` for improved dynamic route registration. - Updated core tests to include comprehensive test cases for `registerRouters`, covering various scenarios such as registering routes, handling path parameters, and supporting nested routers. - Ensured that existing routes remain functional after new registrations.
- Added the `registerRouters` method to the `Application` class, allowing for dynamic registration of routers at runtime. - This enhancement enables immediate effect for subsequent requests, improving flexibility in route management.
…documentation - Introduced the `DynamicRouterOptions` interface for dynamic route registration, allowing routes to be defined at runtime with flexible options. - Enhanced the `registerRouters` function documentation to include examples and clarify its usage for immediate route registration. - Updated the `Application` class to support dynamic router registration, improving the overall flexibility of route management.
- Added detailed examples for runtime registration of routes from a database in the `examples.md` file. - Updated the `SKILL.md` file to include a section on runtime route registration, clarifying the usage of `registerRouters` and its immediate effect on route handling. - Improved overall documentation to assist developers in understanding dynamic route management within the koapp framework.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
Cursor Bugbot is generating a summary for commit bafc50f. Configure here.