Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add aws ec2 installation. #121

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,68 @@ heroku logs --tail

Send a message to your page from Facebook or in Messenger. If your webhook receives an event, you have fully set up your app! Voilà!

## Using AWS server

#### 1. Pre-Requisites
An AWS EC2 ubuntu/linux instance.

A valid TLS or SSL certificate configured and installed in the AWS EC2 instance.

Map the AWS EC2 instance to a DNS record, eg, https://api.originalcoastclothing.com

#### 2. Launch the EC2 instance and SSH into it.

#### 3. Install Node 10.X or higher in the EC2 instance

#### 4. Clone the Original Coast Clothing repository

```bash
$ git clone [email protected]:fbsamples/original-coast-clothing.git
$ cd original-coast-clothing
```

#### 5. Install the dependencies:
In the repo directiory.

```bash
$ npm install
```

#### 6. Set up .env file

Copy the file `.sample.env` to `.env`

```bash
cp .sample.env .env
```

Edit the `.env` file to add all the values for your app and page. Note that `APP_URL` will be the AWS instance DNS mapped address (eg, https://api.originalcoastclothing.com) from the pre-requisites.

#### 4. Run your app locally

```bash
node app.js
```

Confirm that you can also access it at the external APP_URL from the pre-requisites.

#### 5. Configure your webhook subcription and set the Messenger profile

Use the `VERIFY_TOKEN` that you created in `.env` file and call the **/profile** endpoint in your browser or via cURL:
```
https://APP_URL/profile?mode=all&verify_token=VERIFY_TOKEN
```

This will configure your webhook.

#### 6. Test that your app setup is successful

Send a message to your Page from Facebook or in Messenger.

You should see the webhook called in your application terminal tab.

If you see a response to your message in messenger, you have fully set up your app!

## License

Sample Messenger App Original Coast Clothing is BSD licensed, as found in the LICENSE file.
Expand Down
Loading