feat: add functionality to register plugins via http

Also:

- Add functionality for serving the responses from plugins
- Add tests for related methods and routes

Closes #2, #37
This commit is contained in:
Jovan Krunić
2019-07-04 17:43:36 +02:00
committed by Rainer Killinger
parent 59ea7a5ba6
commit 3d51ccfac2
12 changed files with 3035 additions and 188 deletions

View File

@@ -13,7 +13,7 @@
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import {SCConfigFile} from '@openstapps/core';
import {SCConfigFile, SCPluginMetaData} from '@openstapps/core';
import {Validator} from '@openstapps/core-tools/lib/validate';
import * as config from 'config';
import {BackendTransport} from './notification/backend-transport';
@@ -37,3 +37,8 @@ export const validator = new Validator();
* Provides information if the backend is executed in the "test" (non-production) environment
*/
export const isTestEnvironment = process.env.NODE_ENV !== 'production';
/*
* Stores a ("key-value") list of plugins where key is route and value is plugin information
*/
export const plugins = new Map<string, SCPluginMetaData>();