You can start the server by running npm start
. However, the webhook must be at a public URL that the Facebook servers can reach. Therefore, running the server locally on your machine will not work.
You can run this example on a cloud service provider like Heroku, Google Cloud Platform or AWS. Note that webhooks must have a valid SSL certificate, signed by a certificate authority. Read more about setting up SSL for a Webhook.
All webhook code is in app.js
. It is routed to /webhook
. This project handles callbacks for authentication, messages, delivery confirmation and postbacks. More details are available at the reference docs.
See the LICENSE file in the root directory of this source tree. Feel free to useand modify the code.