This commit is contained in:
@@ -2,7 +2,14 @@ const axios = require('axios');
|
||||
const config = require('../config');
|
||||
|
||||
function sendToWebhook(data) {
|
||||
return axios.post(config.WEBHOOK_URL, data, { timeout: 5000 });
|
||||
const headers = config.WEBHOOK_BEARER_TOKEN
|
||||
? { Authorization: `Bearer ${config.WEBHOOK_BEARER_TOKEN}` }
|
||||
: undefined;
|
||||
|
||||
return axios.post(config.WEBHOOK_URL, data, {
|
||||
timeout: 5000,
|
||||
headers
|
||||
});
|
||||
}
|
||||
|
||||
module.exports = { sendToWebhook };
|
||||
module.exports = { sendToWebhook };
|
||||
|
||||
Reference in New Issue
Block a user