$ sudo mv <檔案目前的位置> /usr/bin/
$ ngrok
$ ngrok http 5000
from flask import Flask, request, abort
from linebot import (
LineBotApi, WebhookHandler
)
from linebot.exceptions import (
InvalidSignatureError
from linebot.models import (
MessageEvent, TextMessage, TextSendMessage,
app = Flask(__name__)
說明
Line API
實作
1.申請帳號
2.設定ngrok
$ sudo mv <檔案目前的位置> /usr/bin/
$ ngrok
$ ngrok http 5000
3.執行Line API
from flask import Flask, request, abort
from linebot import (
LineBotApi, WebhookHandler
)
from linebot.exceptions import (
InvalidSignatureError
)
from linebot.models import (
MessageEvent, TextMessage, TextSendMessage,
)
app = Flask(__name__)