Skip to content

Feat: register routers - #18

Open
AxiosLeo wants to merge 5 commits into
mainfrom
feat/registerRouters
Open

Feat: register routers#18
AxiosLeo wants to merge 5 commits into
mainfrom
feat/registerRouters

Conversation

@AxiosLeo

@AxiosLeo AxiosLeo commented Aug 14, 2026

Copy link
Copy Markdown
Owner

Note

Cursor Bugbot is generating a summary for commit bafc50f. Configure here.

- 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant