forked from pnxtech/hydra-express
-
Notifications
You must be signed in to change notification settings - Fork 0
/
plugin.js
36 lines (33 loc) · 884 Bytes
/
plugin.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
'use strict';
const HydraPlugin = require('hydra/plugin');
/**
* @name HydraExpressPlugin
* @description Extend this for hydra-express plugins
* @extends HydraPlugin
*/
class HydraExpressPlugin extends HydraPlugin {
/**
* @param {string} pluginName - unique name for the plugin
*/
constructor(pluginName) {
super(pluginName);
}
/**
* @name setHydraExpress
* @param {object} hydraExpress - hydra express instance
*/
setHydraExpress(hydraExpress) {
this.setHydra(hydraExpress.getHydra());
this.hydraExpress = hydraExpress;
}
/**
* @name setConfig
* @param {string} serviceConfig - the service-level config
* @param {object} serviceConfig.hydra - the hydra-level config
*/
setConfig(serviceConfig) {
super.setConfig(serviceConfig.hydra);
this.serviceConfig = serviceConfig;
}
}
module.exports = HydraExpressPlugin;