https://github.com/ctlong/everprayer
https://github.com/ctlong/everprayer
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/ctlong/everprayer
- Owner: ctlong
- License: mit
- Created: 2018-01-15T09:27:36.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-01-19T07:34:55.000Z (over 8 years ago)
- Last Synced: 2025-03-20T23:15:11.677Z (over 1 year ago)
- Language: JavaScript
- Size: 6.68 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# EverPrayer
This project is an example bot for Messenger Platform built in Node.js. With this app, you can request prayers and it will output a random prayer.
It contains the following functionality:
* Webhook (specifically for Messenger Platform events)
* Send API
* Web Plugins
* Messenger Platform v1.1 features
## Setup
Create `config/default.json` with variables: `appSecret`, `pageAccessToken`, `validationToken`, and `serverURL` before running the app. Descriptions of each parameter can be found in `app.js`. Alternatively, you can set the corresponding environment variables as defined in `app.js`.
Replace values for `APP_ID` and `PAGE_ID` in `public/index.html`.
## Run
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](https://developers.facebook.com/docs/graph-api/webhooks#setup).
## 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](https://developers.facebook.com/docs/messenger-platform/webhook-reference).
## License
See the LICENSE file. Feel free to use and modify the code.