You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
733 B
24 lines
733 B
import os |
|
import connexion |
|
from flask_sqlalchemy import SQLAlchemy |
|
from flask_marshmallow import Marshmallow |
|
|
|
basedir = os.path.abspath(os.path.dirname(__file__)) |
|
|
|
# Creates the Connexion application instance |
|
connex_app = connexion.App(__name__, specification_dir=basedir) |
|
|
|
# Gets the underlying Flask app instance |
|
app = connex_app.app |
|
database_uri = "sqlite:////" + os.path.join(basedir, "readings.db") |
|
|
|
# Configures the SQLAlchemy part of the app instance |
|
app.config["SQLALCHEMY_ECHO"] = True # Set to false in prod. |
|
app.config["SQLALCHEMY_DATABASE_URI"] = database_uri |
|
app.config["SQLALCHEMY_TRACK_MODIFICATIONS"] = False |
|
|
|
# Creates the SQLAlchemy db instance |
|
db = SQLAlchemy(app) |
|
|
|
# Initialises Marshmallow |
|
ma = Marshmallow(app)
|
|
|