Test App to test functionality with Slack API
It's an app to demonstrate the Slack messaging integration. Here is how it works? First a user is selected from the dropdown menu (under whose name the message will be sent). Type the message in the box and click 'Send Message' button. The message will be delivered to the Slack channel you set it up with.
How to run it?
- Clone this project using
git clone
command. - Create a file named
env-variables.env
in the root directory in which we will provide our Slack App's configuration variables. - Visit https://api.slack.com/apps and create a new app.
- Add Incoming Webhook integration and it must have access to users:read scope.
- Copy OAuth Access Token from the OAuth and Permissions tab and Webhook URL from the Incoming Webhooks tab.
- Paste the OAuth Access Token and Webhook URL in the
env-variables.env
file as shown below:
SLACK_WEBHOOK_URL=<Webhook URL>
SLACK_API_TOKEN=<OAuth Access Token>
SLACK_CHANNEL=<Slack channel name (without the leading #) linked with the incoming webhook>
- Install
docker
anddocker-compose
from https://docs.docker.com/install/ - Run the following command in the terminal. It will build the image and start the app using
docker-compose
.
docker-compose up -d
- Open your web browser and navigate to http://localhost:3000/messages
Author
- Jabarjung Sandhu