Do not waste energy on re-inventing the wheel - use existing solution named NPM Modules :)
You were right to feel that this isn't the way.
The best approach for it, IMO, is NodeJs' NPM modules, which you could write some yourself.
As for the handler binding execution order of the "get"/"post"/etc - you still could control the package loading order, do not forget that, so you can achieve it all in a "standard" way.
Edit #1:
- You can use
private
- For highly specialized sub-components example I can recommend you look at the PassportJS project. It's about authentication with external platforms such as Facebook and Google, and every platform you want to enable in a project is a separate NPM module.
- What makes you think you cannot unload/reload modules at runtime? Yes, you simply can.