-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
38 lines (28 loc) · 981 Bytes
/
app.py
File metadata and controls
38 lines (28 loc) · 981 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
37
38
"""
Postgres Handler.
Insertion into Postgres database for various tables.
Tables:
- `messages`
- Twilio SMS messages.
- `contacts`
- Every # that has sent a message or called the Twilio number.
- Includes the `SenderName` if able to be determined via the Twilio API.
- This is provided in SMS messages, though is `Unknown` if not found.
- `banned`
- Numbers that have been banned from sending messages.
- (e.g. showing up on the dashboard/other consumers)
"""
import logging
from flask import Flask
from utils.logging import configure_logging
from config import APP_PORT
logging.root.handlers = []
logger = configure_logging()
app = Flask(__name__)
@app.route("/")
def hello_world():
"""Serve a simple static Hello World page at the root"""
return "<h1>wbor-postgres-driver is online!</h1>"
if __name__ == "__main__":
# Only start the Flask app; Gunicorn handles consumer initialization
app.run(host="0.0.0.0", port=APP_PORT)