Skip to content

Commit 6b21aa8

Browse files
author
Hyunje Jun
committed
Add start scripts and webhook info to examples
1 parent 4b8c772 commit 6b21aa8

File tree

5 files changed

+25
-7
lines changed

5 files changed

+25
-7
lines changed

examples/echo-bot/README.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,28 @@ An example LINE bot just to echo messages
44

55
## How to use
66

7-
Install deps:
7+
### Install deps
88

9-
```bash
9+
``` shell
1010
$ npm install
1111
```
1212

13-
Configuration:
13+
### Configuration
1414

15-
``` bash
15+
``` shell
1616
$ export CHANNEL_SECRET=YOUR_CHANNEL_SECRET
1717
$ export CHANNEL_ACCESS_TOKEN=YOUR_CHANNEL_ACCESS_TOKEN
1818
$ export PORT=1234
1919
```
2020

21-
Run:
21+
### Run
2222

23-
``` bash
23+
``` shell
2424
$ node .
2525
```
26+
27+
## Webhook URL
28+
29+
```
30+
https://your.base.url/callback
31+
```

examples/echo-bot/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const app = express();
1818

1919
// register a webhook handler with middleware
2020
// about the middleware, please refer to doc
21-
app.post('/webhook', line.middleware(config), (req, res) => {
21+
app.post('/callback', line.middleware(config), (req, res) => {
2222
Promise
2323
.all(req.body.events.map(handleEvent))
2424
.then((result) => res.json(result));

examples/echo-bot/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
"version": "0.0.0",
44
"description": "An example LINE bot just to echo messages",
55
"main": "index.js",
6+
"scripts": {
7+
"start": "node ."
8+
},
69
"dependencies": {
710
"@line/bot-sdk": "^5.0.0",
811
"express": "^4.15.2"

examples/kitchensink/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,9 @@ export PORT=1234
2727
``` shell
2828
node .
2929
```
30+
31+
## Webhook URL
32+
33+
```
34+
https://your.base.url/callback
35+
```

examples/kitchensink/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
"version": "0.0.0",
44
"description": "A kitchen-sink LINE bot example",
55
"main": "index.js",
6+
"scripts": {
7+
"start": "node ."
8+
},
69
"dependencies": {
710
"@line/bot-sdk": "^5.0.0",
811
"express": "^4.16.2"

0 commit comments

Comments
 (0)