Skip to content

Commit

Permalink
Add start scripts and webhook info to examples
Browse files Browse the repository at this point in the history
  • Loading branch information
Hyunje Jun committed Dec 7, 2017
1 parent 4b8c772 commit 6b21aa8
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 7 deletions.
18 changes: 12 additions & 6 deletions examples/echo-bot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,28 @@ An example LINE bot just to echo messages

## How to use

Install deps:
### Install deps

```bash
``` shell
$ npm install
```

Configuration:
### Configuration

``` bash
``` shell
$ export CHANNEL_SECRET=YOUR_CHANNEL_SECRET
$ export CHANNEL_ACCESS_TOKEN=YOUR_CHANNEL_ACCESS_TOKEN
$ export PORT=1234
```

Run:
### Run

``` bash
``` shell
$ node .
```

## Webhook URL

```
https://your.base.url/callback
```
2 changes: 1 addition & 1 deletion examples/echo-bot/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const app = express();

// register a webhook handler with middleware
// about the middleware, please refer to doc
app.post('/webhook', line.middleware(config), (req, res) => {
app.post('/callback', line.middleware(config), (req, res) => {
Promise
.all(req.body.events.map(handleEvent))
.then((result) => res.json(result));
Expand Down
3 changes: 3 additions & 0 deletions examples/echo-bot/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
"version": "0.0.0",
"description": "An example LINE bot just to echo messages",
"main": "index.js",
"scripts": {
"start": "node ."
},
"dependencies": {
"@line/bot-sdk": "^5.0.0",
"express": "^4.15.2"
Expand Down
6 changes: 6 additions & 0 deletions examples/kitchensink/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,9 @@ export PORT=1234
``` shell
node .
```

## Webhook URL

```
https://your.base.url/callback
```
3 changes: 3 additions & 0 deletions examples/kitchensink/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
"version": "0.0.0",
"description": "A kitchen-sink LINE bot example",
"main": "index.js",
"scripts": {
"start": "node ."
},
"dependencies": {
"@line/bot-sdk": "^5.0.0",
"express": "^4.16.2"
Expand Down

0 comments on commit 6b21aa8

Please sign in to comment.