I am currently working on a large application in Node.JS , on top of Express .
I was hoping to do something plug & play-able, so I started writing my own small plug-in system, the file structure of which is as follows:
root/ | plugins.json # configures all plugins | plugins # contains all plugins | | MyPlugin # contains MyPlugin | | | MyPlugin.js # defines Application hooks for MyPlugin | | | ...
MyPlugin/ , of course, also contains Routes, Controllers, Views, certain resources, etc.
The standard hooks that the app will call the MyPlugin instance are:
moduleInit(app)
So far, itβs so good, but now everything is getting complicated (and they will always only get more complicated), since I have to consider the sequence of module initialization (since they can be attached to the processor stack using use , get , post , etc.) and much more another ...
Since I'm still a little new to Node and Express, I have doubts: Maybe there is already a good engine that does all this? I could not find him, which makes me believe that this might be a bad idea? Maybe there is more "node" or "express" - a way to do what I'm missing?
Thank you for your help!
Domi
source share