metarhia / impress

Enterprise application server for Node.js and Metarhia private cloud ⚡
https://metarhia.com
MIT License
970 stars 129 forks source link

Refactor plugin interface #472

Closed tshemsedinov closed 8 years ago

tshemsedinov commented 8 years ago

Plugin file: impress.<pluginName>.js

  1. It exports nothing
  2. After require it sets impress.<pluginName>.mixin = function(application) to be optionally called if exists
  3. After mixin called it sets application.<pluginName>.init function() to be optionally called if needed
  4. On mixin it may set application.on events, e.g. : start, clientConnect, etc.
  5. Plugin have a flag mixImpress it indicates do we need mix it to the main application impress
tshemsedinov commented 8 years ago

Merged with https://github.com/metarhia/Impress/issues/511