-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.py
More file actions
36 lines (22 loc) · 865 Bytes
/
Copy pathmain.py
File metadata and controls
36 lines (22 loc) · 865 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
from flask import Flask
import logging
from views import webhook_blueprint
from config import Config
from ai_bot import AIBot
def create_app():
#app set up function
app = Flask(__name__)
Config.configure_logging()
app.register_blueprint(webhook_blueprint)
#create a separate bot instance for each phone number,
#this allows different users to have separate conversations with the chatbot
#it also allows different users to use different google callendar APIs
app.bot_instance = AIBot()
return app
if __name__ == '__main__':
app = create_app()
logging.info('Flask app started')
app.run(host='0.0.0.0', port=5000)
#running app:
#1) python3 main.py
#2) ngrok http 5000 --domain=light-goat-driving.ngrok-free.app (expose to the web using ngrok) surely-welcome-asp.ngrok-free.app