-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
26 lines (19 loc) · 727 Bytes
/
app.py
File metadata and controls
26 lines (19 loc) · 727 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
#!/usr/bin/env python3
import flask
import psycopg2
import psycopg2.extras
from configs import configs
# Load the configuration
config = configs.parseConfig()
# Start up the database connection, by default returning dictionaries with property names from queries
db = psycopg2.connect(**config['database'], cursor_factory=psycopg2.extras.RealDictCursor)
# Run the session in autocommit (ie, non-transactional) mode by default. Do not change this setting.
db.set_session(autocommit=True)
# Build a basic Flask app
app = flask.Flask(__name__)
from routes import ping
from routes import accounts
from routes import transactions
# Start the app listening.
if __name__ == '__main__':
app.run(port=config['server']['port'])