Skip to content

Randyanto/line-bot-example-nodejs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kitchen Sink Bot

A kitchen-sink LINE bot example

Requirements

Install npm dependencies:

npm install

Also, FFmpeg and ImageMagick should be installed to test image and video echoing.

Configuration

Create .env file in the root folder with these variables.

CHANNEL_SECRET=YOUR_CHANNEL_SECRET
CHANNEL_ACCESS_TOKEN=YOUR_CHANNEL_ACCESS_TOKEN
BASE_URL=https://your.base.url # remove BASE_URL if you run it locally
PORT=80

Run webhook server

npm start

With the configuration above, the webhook listens on https://your.base.url:80/callback.

ngrok usage

ngrok tunnels external requests to localhost, helps debugging local webhooks.

This example includes ngrok inside, and it just works if no BASE_URL is set. Make sure that other configurations are set correctly.

❯ npm start

...

It seems that BASE_URL is not set. Connecting to ngrok...
listening on https://ffffffff.ngrok.io/callback

The URL can be directly registered as the webhook URL in LINE Developers console.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published