DEV Community

Nabheet Madan
Nabheet Madan

Posted on

My first Custom Slack App - Part 3

Blogs in the Series

Part Description
1 Setting the backend
2 Setting the API server to talk to Backend as well as frontend
3 Setting the Frontend to talk to API server
4 Deploying the app to something permanent
5 Research on deploying to slack app store

What we have done so far?

In our previous Blog we have set up our NodeJS app which will talk to google spreadsheet. So lets now create our frontend slack app which will interact our NodeJS application and as well as deploy the local running NodeJS app to SAP cloud foundry trial.

Deploying the NodeJS application to SAP Cloud foundry trial

Before actually setting app we need to deploy our app so that we can provide the callback url of the deployed application. I being from SAP background so have used the SAP Cloud Platform Cloud foundry trial version for the same, you can use any.

  • Go to SAP and create a free trial version.
  • Once your account is set up, you need to login, choose Cloud Foundry and go with creation and activation steps
  • You must have seen the deployed NodeJS slack application in previous picture. In order deploy an application you first need to install CF CLI follow this SAP Developers tutorial to install the same. Once you have logged in and set up your endpoint and all you need to execute below mentioned command in the NodeJS app folder to deploy the app.
cf push <app name> -b https://github.com/cloudfoundry/nodejs-buildpack
  • Once the application is deployed you will the endpoint in the dashboard as well CLI. This endpoint of the application will be used in setting up Slack app.

Setting up Slack

Now we our endpoint ready, lets set up our slack app.

  • Go to Slack app and create a new app.
  • Choose Features and functionality what you want to activate. Since our app has events, interactive components, slash commands so we choose them.
  • Events set up, please note we have appended /slack/events to the URL.
  • Slash Commands set up, please note we have appended /slack/events to the URL.
  • Bot Set up
  • Interactive actions set up
  • If you remember in our previous blog we have used signing secret and token you can find them as shown below.

Live Demo

Here is the live working demo. This is the basic version which can be extended as per the need.

What is next?

So now we have our custom app which is deployed to SAP Cloud foundry trial up and running, next step is to find permanent place for it. What better than our OpenFaaS cloud. We will deploy this application to OpenFaaS.

Discussion (0)