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:
Copy file name to clipboardExpand all lines: README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -187,7 +187,7 @@ This server exposes the following REST API's:
187
187
Allows you to edit the ElastAlert configuration from `config.yaml` in `elastalertPath` (from the config). The required body to be send will be edited when the work on this API is done.
188
188
189
189
## Contributing
190
-
Want to contribute to this project? Great! Please read our [contributing guidelines](../CONTRIBUTING.md) before submitting an issue or a pull request.
190
+
Want to contribute to this project? Great! Please read our [contributing guidelines](CONTRIBUTING.md) before submitting an issue or a pull request.
191
191
192
192
**We only accept pull requests on our [GitHub repository](https://github.com/bitsensor/elastalert)!**
0 commit comments