-
Notifications
You must be signed in to change notification settings - Fork 60
/
app.py
34 lines (20 loc) · 1009 Bytes
/
app.py
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
########### BASE IMPORTS ###############################
from flask import Flask, Response
import base64
import flask_restful as restful
from flasgger import Swagger
######### ENVIRONMENT CONFIGS ###########################
from configs.readconfig import configp
app = Flask(__name__)
apy = restful.Api(app)
from controllers.single_message import WhatsAppSingleMessage
apy.add_resource(WhatsAppSingleMessage, '/api/v0.1/send_single_message')
from controllers.broadcast_message import WhatsAppBroadcastMessage
apy.add_resource(WhatsAppBroadcastMessage, '/api/v0.1/send_broadcast_message')
from controllers.listen_message import WhatsAppMessageListener
apy.add_resource(WhatsAppMessageListener, '/api/v0.1/listen_new_message')
from controllers.add_new_contact import WhatsAppNewContactListener
apy.add_resource(WhatsAppNewContactListener, '/api/v0.1/add_new_contact')
if __name__ == '__main__':
app.run(host='0.0.0.0', debug=True, port=5000, threaded=True)
#app.run(debug=True, threaded=True)