|
|
@@ -7,6 +7,7 @@ import { WebhookHandler } from './webhookHandler.js';
|
|
|
|
|
|
export class WebhookServer {
|
|
|
constructor(options = {}) {
|
|
|
+ this.host = options.host || '0.0.0.0';
|
|
|
this.port = options.port || 3000;
|
|
|
this.path = options.path || '/webhook';
|
|
|
this.secret = options.secret || null;
|
|
|
@@ -108,10 +109,10 @@ export class WebhookServer {
|
|
|
start() {
|
|
|
this.server = http.createServer((req, res) => this._handleRequest(req, res));
|
|
|
|
|
|
- this.server.listen(this.port, () => {
|
|
|
- logger.info(`Webhook server listening on port ${this.port}`);
|
|
|
- logger.info(`Webhook endpoint: http://localhost:${this.port}${this.path}`);
|
|
|
- logger.info(`Health check: http://localhost:${this.port}/health`);
|
|
|
+ this.server.listen(this.port, this.host, () => {
|
|
|
+ logger.info(`Webhook server listening on ${this.host}:${this.port}`);
|
|
|
+ logger.info(`Webhook endpoint: http://${this.host}:${this.port}${this.path}`);
|
|
|
+ logger.info(`Health check: http://${this.host}:${this.port}/health`);
|
|
|
});
|
|
|
|
|
|
return this;
|