Plugable "extra" modules mechanism
We will need to be able to plug new modules with extra functionality for AEON. Some desired requirements:
- This extra modules dont live into the REST directory. They should be installed as node.js packages.
- Once installed, these could be enabled through configuration files
- Consensus for naming these modules. We will need to be able to know which modules are installed, maybe something like AEONWorkerSomething.
Consider the "workers" patterns we are using in the requests chains we are using: worker
So, a new installation of an extra module will export:
- A chainable worker functionality for any request as seen in:
/*
* Pub/Sub chain.
* To publish the right chain will be formed by three steps:
* step1: check the message correctness regarding the type of channel
* step2: publish the message
* step3: log the operation into the DDBB
*/
var pubChain = {
"workerstep1": topicWorkers.workerTopicDump,
"workerstep2": channel.publish,
"workerstep3": logWorkers.workerLogMessageMongo
}
app.post('/publish/:pubID', passDBConnection, passBroker, getChannel,
pubChain.workerstep1,
pubChain.workerstep2,
pubChain.workerstep3,
function (req, res){
logger.info("end of pub chain");
}
);
- It also exports new REST routes. For example: functionalities for payments.