Skip to content

New: Add registerRoutes utility for non-API modules#59

Merged
taylortom merged 3 commits intomasterfrom
feature/register-routes-utility
Feb 26, 2026
Merged

New: Add registerRoutes utility for non-API modules#59
taylortom merged 3 commits intomasterfrom
feature/register-routes-utility

Conversation

@taylortom
Copy link
Collaborator

New

  • A reusable registerRoutes(router, routes, auth) utility that handles addRoute + secureRoute/unsecureRoute wiring for route config arrays, eliminating the repeated loop pattern across non-API module consumers of loadRouteConfig

Follows on from #58 which added loadRouteConfig. This extracts the common consumer loop into a shared utility.

Testing

  1. npx standard passes
  2. Verify importing { registerRoutes } from adapt-authoring-server resolves correctly
  3. Start the app and verify all routes still register as expected

@taylortom taylortom merged commit db029ba into master Feb 26, 2026
2 checks passed
@taylortom taylortom deleted the feature/register-routes-utility branch February 26, 2026 18:28
github-actions bot pushed a commit that referenced this pull request Feb 26, 2026
# [2.2.0](v2.1.0...v2.2.0) (2026-02-26)

### Fix

* Update documentation for Express v5 and routes.json pattern ([79bec3a](79bec3a))

### New

* Add override option for default route merging in loadRouteConfig (refs #58) ([35cd7f2](35cd7f2)), closes [#58](#58)
* Add registerRoutes utility for non-API modules (#59) ([db029ba](db029ba)), closes [#59](#59)
* Add registerRoutes utility for non-API modules (refs #58) ([672525c](672525c)), closes [#58](#58)
@github-actions
Copy link

🎉 This PR is included in version 2.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant