Skip to content

Instantly share code, notes, and snippets.

@ismail1432
Last active January 3, 2022 09:22
Show Gist options
  • Save ismail1432/7d715c908c8d595c0f41d8b8e31a1069 to your computer and use it in GitHub Desktop.
Save ismail1432/7d715c908c8d595c0f41d8b8e31a1069 to your computer and use it in GitHub Desktop.
<?php
// config.php
// config can be done with constant
const ENDPOINT_TO_CHECK = ['www.google.com', 'http://127.0.0.1:8000'];
const SLACK_CHANNEL = 'monitoring-web-app'; // channel where post the message
const SLACK_URL = 'https://slack.com/api/chat.postMessage';
const SLACK_TOKEN= 'token given by slack';
// config with function to fetch env var...
function getSlackUrl(): string
{
return SLACK_URL;
}
function getEndPointToCheck(): array
{
return ENDPOINT_TO_CHECK;
}
function getSlackToken(): string
{
return SLACK_TOKEN;
}
function getSlackChannel(): string
{
return SLACK_CHANNEL;
}
@peter279k
Copy link

Please fix typo: monitoring-web-app.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment