https://github.com/sashimii/paperbot
Robots taking over news
https://github.com/sashimii/paperbot
Last synced: 2 months ago
JSON representation
Robots taking over news
- Host: GitHub
- URL: https://github.com/sashimii/paperbot
- Owner: sashimii
- License: mit
- Created: 2016-09-06T18:33:32.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-01-11T17:47:25.000Z (over 8 years ago)
- Last Synced: 2025-01-12T23:09:11.694Z (4 months ago)
- Language: JavaScript
- Size: 6.77 MB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Messenger Platform Sample -- node.js
This project is an example server for Messenger Platform built in Node.js. With this app, you can send it messages and it will echo them back to you. You can also see examples of the different types of Structured Messages.
It contains the following functionality:
* Webhook (specifically for Messenger Platform events)
* Send API
* Web Plugins
* Messenger Platform v1.1 featuresFollow the [walk-through](https://developers.facebook.com/docs/messenger-platform/quickstart) to learn about this project in more detail.
## Setup
Set the values in `config/default.json` before running the sample. 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).
## "Send to Messenger" and "Message Us" Plugin
An example of the "Send to Messenger" plugin and "Message Us" plugin are located at `index.html`. The "Send to Messenger" plugin can be used to trigger an authentication event. More details are available at the [reference docs](https://developers.facebook.com/docs/messenger-platform/plugin-reference).
## License
See the LICENSE file in the root directory of this source tree. Feel free to useand modify the code.