This is a small configurable bot that checks URL-x for status at every x-minutes and notifies any x-channel on your slack workspace.
You might end up modifying your API to have a separate /api/status GET route (check ./server.js)
- Create a Slack App
- Create appropriate scope for the app(chats:read,chats:join)
- Get the token xoxb..
- Add the app to your workspace
- /invite the app to your channel
docker image build -t <your-tag> .
docker run -d -e URL=<YOUR_URL> -e SLACK_TOKEN=<YOUR_SLACK_TOKEN> -e MINUTE=<MINUTE_VALUE> -e CHANNEL=<CHANNEL_NAME> <IMAGE_NAME>
-
Once everything is setup,you will get the error posted to your channel.
-
In case you want to test, grab the id of your container and go inside it
docker exec -it <container-id> sh
- run the server (at localhost:3002) and set the URL in the container as localhost:3002
npm run dev