0

I am trying to create a bot. Using this project. My setup is as follows:

Amazon EC2 instance. I created a sub-domain.domain.com I have added the ssl certifications. I have pointed the sub-domain to the /var/www/sub-domain/

I have installed the unzip and installed the project in /var/www/sub-domain/project/ I have configured the project and correctly run it:

Node app is running on port 5000

If I access http://sub-domain.domain.com:5000 I access to the projects public index. I understand that means the port is open and the node app works.

Now when I am trying to configure in facebook my webhook I dont understand what url callbak to use. From what I understand in the configuration the server url whould be https://sub-domain.domain.com and the configuration should work. but it doesnt.

What url should I use?

parwatcodes
  • 6,669
  • 5
  • 27
  • 39

2 Answers2

0

Your callback URL should be your actual file where facebook would send user data. Like if you were using PHP, you'd say: http://yourhost/chatbot.php. Currently, webhook would be the URL on which your node app is listening.

mehulmpt
  • 15,861
  • 12
  • 48
  • 88
0

Your webhook needs to an accessible URL. I don't know which sample code you used, but my guess is that with your current set up you should use http://sub-domain.domain.com:5000/webhook.

You can use Apache or Nginx to make it accessible on http://sub-domain.domain.com/webhook (port 80) with ProxyPass/proxy_pass directives.

I have installed the unzip and installed the project in /var/www/sub-domain/project/ [...] I access to the projects public index

The Javascript files of your project don't need to and should not be accessible to the public, as they may contain your application's secret IDs and tokens.

chrki
  • 6,143
  • 6
  • 35
  • 55