I want to send message to Slack hook using JavaScript code:
const slackEndpoint = 'https://hooks.slack.com/services/.........';
axios.post(slackEndpoint,
{text: message})
.then(response =>{
return response.statusText})
.catch((error) => console.log(error));
But from time to time I get timeout. I tried to add await like this:
const slackEndpoint = 'https://hooks.slack.com/services/.........';
await axios.post(slackEndpoint,
{text: message})
.then(response =>{
return response.statusText})
.catch((error) => console.log(error));
But when I send a message nothing happens. Do you know what might be the issue?