-
Notifications
You must be signed in to change notification settings - Fork 13
/
manifest.js
36 lines (35 loc) · 1.28 KB
/
manifest.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
module.exports = {
version: '1.3.0',
init: function (pluginContext) {
pluginContext.registerPolicy(require('./policies/example-policy'));
pluginContext.registerCondition(require('./conditions/url-match'));
pluginContext.registerGatewayRoute(require('./routes/hello-eg'));
pluginContext.registerAdminRoute(require('./routes/hello-admin'));
pluginContext.eventBus.on('hot-reload', function ({ type, newConfig }) {
console.log('hot-reload', type, newConfig);
});
pluginContext.eventBus.on('http-ready', function ({ httpServer }) {
console.log('http ready');
});
pluginContext.eventBus.on('https-ready', function ({ httpsServer }) {
console.log('https ready');
});
pluginContext.eventBus.on('admin-ready', function ({ adminServer }) {
console.log('admin ready');
});
},
policies:['example'], // this is for CLI to automatically add to "policies" whitelist in gateway.config
schema: { // This is for CLI to ask about params 'eg plugin configure example'
baseUrl: {
title: 'Base Url',
description: 'the base url to initialize',
type: 'string',
required: true
},
maxRequestsPerSecond: {
title: 'Max Requests per second',
description: 'the max rps value',
type: 'number'
}
}
};