diff --git a/examples/echo-bot/README.md b/examples/echo-bot/README.md index 9849ec2a5..cf988a33b 100644 --- a/examples/echo-bot/README.md +++ b/examples/echo-bot/README.md @@ -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 +``` diff --git a/examples/echo-bot/index.js b/examples/echo-bot/index.js index 4c15e24f5..057234889 100644 --- a/examples/echo-bot/index.js +++ b/examples/echo-bot/index.js @@ -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)); diff --git a/examples/echo-bot/package.json b/examples/echo-bot/package.json index 5c5690019..3dd0652b0 100644 --- a/examples/echo-bot/package.json +++ b/examples/echo-bot/package.json @@ -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" diff --git a/examples/kitchensink/README.md b/examples/kitchensink/README.md index fcf568820..0912ae674 100644 --- a/examples/kitchensink/README.md +++ b/examples/kitchensink/README.md @@ -27,3 +27,9 @@ export PORT=1234 ``` shell node . ``` + +## Webhook URL + +``` +https://your.base.url/callback +``` diff --git a/examples/kitchensink/package.json b/examples/kitchensink/package.json index 9d102c668..f1a6a52cb 100644 --- a/examples/kitchensink/package.json +++ b/examples/kitchensink/package.json @@ -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"