You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+6Lines changed: 6 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -85,11 +85,14 @@ Controllers expose API that can be used by the handlers. There are a couple thin
85
85
86
86
- be a classnamed`[controllerName]Controller`
87
87
- use a logger to log important stuff. You can create a newlogger by:
88
+
88
89
```javascript
89
90
import Logger from 'path/to/common/logger';
90
91
let logger = new Logger('[className]');
91
92
```
93
+
92
94
- have an instance of it accessible by the `ElastalertServer`. In the `start()`function in the [`ElastalertServer`](../src/elastalert_server.js) you see
95
+
93
96
```javascript
94
97
config.ready(function () {
95
98
try {
@@ -100,10 +103,13 @@ Controllers expose API that can be used by the handlers. There are a couple thin
100
103
});
101
104
```
102
105
You should add an instance of your controller there:
106
+
103
107
```javascript
104
108
self._controllerNameController = new controllerName();
105
109
```
110
+
106
111
You should also provide a getter for the controller:
0 commit comments