Search code examples
herokunpmbotsslackngrok

How to run my Slack chatbot on Heroku?


I recently built a Slack chatbot using this tutorial: https://youtu.be/jTaoU6u1Fcg

It worked great.

Now, I'm trying to run my bot on Heroku instead (so it works 24/7) but can't find anywhere online on how to do it.

The specific questions I need answered are:

  1. What PORT do I add to my .env file now? (since I want it on a remote server public, I guess the answer isn't 3000 anymore)
  2. Where (on Heroku) do I find the redirect URL for Oauth & Permissions?
  3. Where (on Heroku) do I find the request URL for Event Subscriptions?
  4. Will I still need to use ngrok or npm install? If I want the app to run 24/7, is Heroku enough?

Thanks for any help.


Solution

  • I just recently deployed a chatbot on heroku. The answers to your questions will be: 1. I kept the port same at 3000 and that will work on heroku as well. 2. I don't think you need to do anything on the heroku. 3. I don't think you need to do anything on the heroku. 4. ngrok wont work now but instead of ngrok url you will have add the url given by heroku (e.g. http://yourappname.herokuapp.com/) on your slack interactive elements and slash commands if you use them.

    I hope this should fix your problem. One more thing there will be a proc file in heroku where you will have to give the entry path of your app.